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 01/21] 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 02/21] 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 03/21] 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 04/21] 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 05/21] 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 06/21] 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 07/21] 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 08/21] 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 09/21] 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 10/21] 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 11/21] 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 12/21] 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 13/21] 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 14/21] 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 15/21] 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 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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