From 034c5fd16d63a08c9f546792ff11bc265c4859f9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Aug 2023 18:24:13 +0000 Subject: [PATCH 1/8] chore(main): release 2.17.1-SNAPSHOT (#1173) :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). --- datastore-v1-proto-client/pom.xml | 4 ++-- google-cloud-datastore-bom/pom.xml | 10 +++++----- google-cloud-datastore/pom.xml | 4 ++-- grpc-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- proto-google-cloud-datastore-v1/pom.xml | 4 ++-- versions.txt | 12 ++++++------ 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml index 634f8dd6e..7563b3356 100644 --- a/datastore-v1-proto-client/pom.xml +++ b/datastore-v1-proto-client/pom.xml @@ -19,12 +19,12 @@ 4.0.0 com.google.cloud.datastore datastore-v1-proto-client - 2.17.0 + 2.17.1-SNAPSHOT com.google.cloud google-cloud-datastore-parent - 2.17.0 + 2.17.1-SNAPSHOT jar diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml index a7b54e305..68c5f1d83 100644 --- a/google-cloud-datastore-bom/pom.xml +++ b/google-cloud-datastore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-datastore-bom - 2.17.0 + 2.17.1-SNAPSHOT pom com.google.cloud @@ -52,22 +52,22 @@ com.google.cloud google-cloud-datastore - 2.17.0 + 2.17.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.17.0 + 2.17.1-SNAPSHOT com.google.api.grpc proto-google-cloud-datastore-v1 - 0.108.0 + 0.108.1-SNAPSHOT com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index 1d5f83046..ed5e8557c 100644 --- a/google-cloud-datastore/pom.xml +++ b/google-cloud-datastore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-datastore - 2.17.0 + 2.17.1-SNAPSHOT jar Google Cloud Datastore https://github.com/googleapis/java-datastore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-datastore-parent - 2.17.0 + 2.17.1-SNAPSHOT google-cloud-datastore diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml index 83076f0de..f47c8d6ec 100644 --- a/grpc-google-cloud-datastore-admin-v1/pom.xml +++ b/grpc-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.17.0 + 2.17.1-SNAPSHOT grpc-google-cloud-datastore-admin-v1 GRPC library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 8fa45820d..a4d405aa6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datastore-parent pom - 2.17.0 + 2.17.1-SNAPSHOT Google Cloud Datastore Parent https://github.com/googleapis/java-datastore @@ -159,27 +159,27 @@ com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.17.0 + 2.17.1-SNAPSHOT com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.17.0 + 2.17.1-SNAPSHOT com.google.cloud google-cloud-datastore - 2.17.0 + 2.17.1-SNAPSHOT com.google.api.grpc proto-google-cloud-datastore-v1 - 0.108.0 + 0.108.1-SNAPSHOT com.google.cloud.datastore datastore-v1-proto-client - 2.17.0 + 2.17.1-SNAPSHOT com.google.api.grpc diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml index a0948a03d..0d19ac6ce 100644 --- a/proto-google-cloud-datastore-admin-v1/pom.xml +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.17.0 + 2.17.1-SNAPSHOT proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index cbb5d557e..4c8e36bf8 100644 --- a/proto-google-cloud-datastore-v1/pom.xml +++ b/proto-google-cloud-datastore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.108.0 + 0.108.1-SNAPSHOT proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.17.0 + 2.17.1-SNAPSHOT diff --git a/versions.txt b/versions.txt index eea775b52..052c90720 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-datastore:2.17.0:2.17.0 -google-cloud-datastore-bom:2.17.0:2.17.0 -proto-google-cloud-datastore-v1:0.108.0:0.108.0 -datastore-v1-proto-client:2.17.0:2.17.0 -proto-google-cloud-datastore-admin-v1:2.17.0:2.17.0 -grpc-google-cloud-datastore-admin-v1:2.17.0:2.17.0 +google-cloud-datastore:2.17.0:2.17.1-SNAPSHOT +google-cloud-datastore-bom:2.17.0:2.17.1-SNAPSHOT +proto-google-cloud-datastore-v1:0.108.0:0.108.1-SNAPSHOT +datastore-v1-proto-client:2.17.0:2.17.1-SNAPSHOT +proto-google-cloud-datastore-admin-v1:2.17.0:2.17.1-SNAPSHOT +grpc-google-cloud-datastore-admin-v1:2.17.0:2.17.1-SNAPSHOT From c7031e8586f0a35fa874fc1bee1e8c40363688f0 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 22 Aug 2023 23:36:34 +0200 Subject: [PATCH 2/8] chore(deps): update dependency com.google.cloud:google-cloud-datastore to v2.17.0 (#1174) 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-datastore](https://togithub.com/googleapis/java-datastore) | `2.16.3` -> `2.17.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:google-cloud-datastore/2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:google-cloud-datastore/2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:google-cloud-datastore/2.16.3/2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:google-cloud-datastore/2.16.3/2.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-datastore (com.google.cloud:google-cloud-datastore) ### [`v2.17.0`](https://togithub.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#2170-2023-08-22) [Compare Source](https://togithub.com/googleapis/java-datastore/compare/v2.16.3...v2.17.0) ##### Features - Publish proto definitions for SUM/AVG in Datastore ([#​1157](https://togithub.com/googleapis/java-datastore/issues/1157)) ([954320a](https://togithub.com/googleapis/java-datastore/commit/954320aaefec249c77c757a1610727519a4029bd)) - Sum and Avg aggregation feature ([#​1067](https://togithub.com/googleapis/java-datastore/issues/1067)) ([56d1001](https://togithub.com/googleapis/java-datastore/commit/56d1001005cf7d52f8ba3e5258d6401be729bdbf)) ##### Dependencies - Update dependency com.google.errorprone:error_prone_core to v2.21.1 ([#​1163](https://togithub.com/googleapis/java-datastore/issues/1163)) ([83158b6](https://togithub.com/googleapis/java-datastore/commit/83158b6172a4a61b3e2a86dea6271ff7f9f84f6b)) - Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.24 ([#​1165](https://togithub.com/googleapis/java-datastore/issues/1165)) ([4094c70](https://togithub.com/googleapis/java-datastore/commit/4094c702982e4a005a36324892daee451bd16062)) - Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.24 ([#​1166](https://togithub.com/googleapis/java-datastore/issues/1166)) ([70cc371](https://togithub.com/googleapis/java-datastore/commit/70cc371babd674000fe6f8d78a0f42e75deb5d99)) ##### Documentation - Update property requirement specifications ([#​1169](https://togithub.com/googleapis/java-datastore/issues/1169)) ([c908837](https://togithub.com/googleapis/java-datastore/commit/c908837ea953a5fdc87f9c83937646d309806e03))
--- ### 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-datastore). --- README.md | 8 ++++---- samples/install-without-bom/pom.xml | 2 +- samples/snapshot/pom.xml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 662c0b5e4..56cc0d604 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ If you are using Maven without the BOM, add this to your dependencies: com.google.cloud google-cloud-datastore - 2.16.3 + 2.17.0 ``` @@ -57,13 +57,13 @@ implementation 'com.google.cloud:google-cloud-datastore' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-datastore:2.16.3' +implementation 'com.google.cloud:google-cloud-datastore:2.17.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.16.3" +libraryDependencies += "com.google.cloud" % "google-cloud-datastore" % "2.17.0" ``` @@ -370,7 +370,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-datastore/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-datastore.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.16.3 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-datastore/2.17.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 0097db7b4..d77507645 100644 --- a/samples/install-without-bom/pom.xml +++ b/samples/install-without-bom/pom.xml @@ -29,7 +29,7 @@ com.google.cloud google-cloud-datastore - 2.16.3 + 2.17.0 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index dbdadb49c..47fb6b3d5 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastore - 2.16.3 + 2.17.0 From b16c0a7ad413b036b6f7a5478e1e427052b397ee Mon Sep 17 00:00:00 2001 From: Prateek Date: Tue, 29 Aug 2023 00:32:31 +0530 Subject: [PATCH 3/8] samples: Add samples for sum and avg aggregations (#1101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: Add samples for sum/avg aggregations * fixing lint * fix snapshot version * fixing snapshot version * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Kristen O'Leary Co-authored-by: Owl Bot --- README.md | 10 +++ samples/snapshot/pom.xml | 6 +- .../aggregation/AvgAggregationOnKind.java | 77 +++++++++++++++++++ .../aggregation/AvgAggregationWithLimit.java | 66 ++++++++++++++++ .../AvgAggregationWithOrderBy.java | 73 ++++++++++++++++++ .../AvgAggregationWithPropertyFilter.java | 74 ++++++++++++++++++ .../MultipleAggregationsInGqlQuery.java | 71 +++++++++++++++++ ...MultipleAggregationsInStructuredQuery.java | 75 ++++++++++++++++++ .../aggregation/SumAggregationOnKind.java | 76 ++++++++++++++++++ .../aggregation/SumAggregationWithLimit.java | 67 ++++++++++++++++ .../SumAggregationWithOrderBy.java | 73 ++++++++++++++++++ .../SumAggregationWithPropertyFilter.java | 74 ++++++++++++++++++ .../AggregationQuerySampleTestIT.java | 74 ++++++++++++++++++ .../snippets/src/test/resources/index.yaml | 21 +++++ 14 files changed, 834 insertions(+), 3 deletions(-) create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithOrderBy.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInGqlQuery.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInStructuredQuery.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationOnKind.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithLimit.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithOrderBy.java create mode 100644 samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithPropertyFilter.java create mode 100644 samples/snippets/src/test/resources/index.yaml diff --git a/README.md b/README.md index 56cc0d604..fd1b011ed 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,10 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-datastore/tre | --------------------------- | --------------------------------- | ------ | | Native Image Datastore Sample | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/native-image-sample/src/main/java/com/example/datastore/NativeImageDatastoreSample.java) | | Quickstart Sample | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/QuickstartSample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/QuickstartSample.java) | +| Avg Aggregation On Kind | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java) | +| Avg Aggregation With Limit | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java) | +| Avg Aggregation With Order By | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithOrderBy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithOrderBy.java) | +| Avg Aggregation With Property Filter | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java) | | Count Aggregation In Transaction | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationInTransaction.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationInTransaction.java) | | Count Aggregation On Kind | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationOnKind.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationOnKind.java) | | Count Aggregation With Gql Query | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithGqlQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithGqlQuery.java) | @@ -269,6 +273,12 @@ Samples are in the [`samples/`](https://github.com/googleapis/java-datastore/tre | Count Aggregation With Order By | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithOrderBy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithOrderBy.java) | | Count Aggregation With Property Filter | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithPropertyFilter.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithPropertyFilter.java) | | Count Aggregation With Stale Read | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithStaleRead.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/CountAggregationWithStaleRead.java) | +| Multiple Aggregations In Gql Query | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInGqlQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInGqlQuery.java) | +| Multiple Aggregations In Structured Query | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInStructuredQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInStructuredQuery.java) | +| Sum Aggregation On Kind | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationOnKind.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationOnKind.java) | +| Sum Aggregation With Limit | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithLimit.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithLimit.java) | +| Sum Aggregation With Order By | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithOrderBy.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithOrderBy.java) | +| Sum Aggregation With Property Filter | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithPropertyFilter.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithPropertyFilter.java) | | Create a union between two filters | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/example/datastore/filters/OrFilterQuery.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/datastore/filters/OrFilterQuery.java) | | Task List | [source code](https://github.com/googleapis/java-datastore/blob/main/samples/snippets/src/main/java/com/google/datastore/snippets/TaskList.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-datastore&page=editor&open_in_editor=samples/snippets/src/main/java/com/google/datastore/snippets/TaskList.java) | diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 47fb6b3d5..689b85ccd 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -23,13 +23,14 @@ UTF-8
- + com.google.cloud google-cloud-datastore - 2.17.0 + 2.17.1-SNAPSHOT + junit @@ -44,7 +45,6 @@ test - diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java new file mode 100644 index 000000000..367837da6 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationOnKind.java @@ -0,0 +1,77 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_avg_aggregation_query_on_kind] + +import static com.google.cloud.datastore.aggregation.Aggregation.avg; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class AvgAggregationOnKind { + + // Instantiates a client. + private static final Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + private static final String kind = "Sales"; + + // Setting up Sales in database + private static void setUpSales() { + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the sales. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).build(), + Entity.newBuilder(sales2Key).set("amount", 95).build(), + Entity.newBuilder(sales3Key).set("amount", 55).build()); + } + + // Accessing aggregation result by the provided custom alias. + private static void usageWithCustomAlias() { + EntityQuery selectAllSales = Query.newEntityQueryBuilder().setKind(kind).build(); + // Creating an aggregation query to get the avg of all sales. + AggregationQuery avgOfSalesQuery = + Query.newAggregationQueryBuilder() + .over(selectAllSales) + // passing 'avg_sales_amount' as alias in the aggregation query. + .addAggregation(avg("amount").as("avg_sales_amount")) + .build(); + // Executing aggregation query. + AggregationResult aggregationResult = + Iterables.getOnlyElement(datastore.runAggregation(avgOfSalesQuery)); + + System.out.printf( + "Average sales is %.8f", aggregationResult.getDouble("avg_sales_amount")); // 79.66666667 + } + + public static void invoke() { + setUpSales(); + usageWithCustomAlias(); + } +} +// [END datastore_avg_aggregation_query_on_kind] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java new file mode 100644 index 000000000..a96ab9317 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithLimit.java @@ -0,0 +1,66 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_avg_aggregation_query_with_limit] + +import static com.google.cloud.datastore.aggregation.Aggregation.avg; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class AvgAggregationWithLimit { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the tasks. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).build(), + Entity.newBuilder(sales2Key).set("amount", 95).build(), + Entity.newBuilder(sales3Key).set("amount", 55).build()); + + EntityQuery selectAllSales = Query.newEntityQueryBuilder().setKind(kind).setLimit(2).build(); + // Creating an aggregation query to get the avg of all sales amount. + AggregationQuery avgOfSalesQuery = + Query.newAggregationQueryBuilder() + .over(selectAllSales) + .addAggregation(avg("amount").as("at_least")) + .build(); + // Executing aggregation query. + AggregationResult limitQueryResult = + Iterables.getOnlyElement(datastore.runAggregation(avgOfSalesQuery)); + + System.out.printf("Average with limit 2 is %d.", limitQueryResult.getLong("at_least")); // 72 + } +} +// [END datastore_avg_aggregation_query_with_limit] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithOrderBy.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithOrderBy.java new file mode 100644 index 000000000..68875b23f --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithOrderBy.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 + * + * 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.datastore.aggregation; + +// [START datastore_avg_aggregation_query_with_order_by] + +import static com.google.cloud.datastore.StructuredQuery.OrderBy.asc; +import static com.google.cloud.datastore.aggregation.Aggregation.avg; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class AvgAggregationWithOrderBy { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the sales. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).set("customerId", 1).build(), + // customerId not specified (orphan record). + Entity.newBuilder(sales2Key).set("amount", 95).build(), + Entity.newBuilder(sales3Key).set("amount", 55).set("customerId", 2).build()); + + // OrderBy acts as an existence filter. + EntityQuery selectAllSales = + Query.newEntityQueryBuilder().setKind(kind).addOrderBy(asc("customerId")).build(); + + // Creating an aggregation query to avg of all sales. + AggregationQuery avgOfSalesQuery = + Query.newAggregationQueryBuilder() + .over(selectAllSales) + .addAggregation(avg("amount").as("avg_of_sales")) + .build(); + // Executing aggregation query. + AggregationResult limitQueryResult = + Iterables.getOnlyElement(datastore.runAggregation(avgOfSalesQuery)); + + System.out.printf( + "Total avg of %d with valid customerId field", + limitQueryResult.getLong("avg_of_sales")); // 72 + } +} +// [END datastore_avg_aggregation_query_with_order_by] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java new file mode 100644 index 000000000..f41b193bc --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java @@ -0,0 +1,74 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_avg_aggregation_query_with_filters] + +import static com.google.cloud.datastore.aggregation.Aggregation.avg; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.cloud.datastore.StructuredQuery.PropertyFilter; +import com.google.common.collect.Iterables; + +public class AvgAggregationWithPropertyFilter { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the tasks. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).set("customerId", 1).build(), + Entity.newBuilder(sales2Key).set("amount", 95).set("customerId", 1).build(), + Entity.newBuilder(sales3Key).set("amount", 55).set("customerId", 2).build()); + + EntityQuery customer1Sales = + Query.newEntityQueryBuilder() + .setKind(kind) + .setFilter(PropertyFilter.eq("customerId", 1)) + .build(); + + // Creating an aggregation query to get the avg of all sales for customerId 1. + AggregationQuery customer1SalesAvg = + Query.newAggregationQueryBuilder() + .over(customer1Sales) + .addAggregation(avg("amount").as("total_sales")) + .build(); + + // Executing aggregation query. + AggregationResult customer1SalesAvgQueryResult = + Iterables.getOnlyElement(datastore.runAggregation(customer1SalesAvg)); + + System.out.printf( + "Customer 1 sales avg is %d", customer1SalesAvgQueryResult.getLong("total_sales")); // 184 + } +} +// [END datastore_avg_aggregation_query_with_filters] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInGqlQuery.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInGqlQuery.java new file mode 100644 index 000000000..40d152598 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInGqlQuery.java @@ -0,0 +1,71 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_multiple_aggregation_in_structured_query] + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.GqlQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class MultipleAggregationsInGqlQuery { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the sales. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).set("customerId", 1).build(), + Entity.newBuilder(sales2Key).set("amount", 95).set("customerId", 1).build(), + Entity.newBuilder(sales3Key).set("amount", 55).set("customerId", 2).build()); + + GqlQuery baseQuery = + Query.newGqlQueryBuilder( + "AGGREGATE COUNT(*) AS total_count," + + " SUM(amount) AS sales_sum," + + " AVG(amount) AS sales_avg " + + "OVER (SELECT * FROM Sales)") + .build(); + + // Creating an aggregation query with COUNT, SUM and AVG aggregations. + AggregationQuery aggregationQuery = Query.newAggregationQueryBuilder().over(baseQuery).build(); + + // Executing aggregation query. + AggregationResult aggregationResult = + Iterables.getOnlyElement(datastore.runAggregation(aggregationQuery)); + + System.out.printf("Total sales count: %d", aggregationResult.getLong("total_count")); // 3 + System.out.printf("Sum of sales: %d", aggregationResult.getLong("sales_sum")); // 239 + System.out.printf( + "Avg of sales: %.8f", aggregationResult.getDouble("sales_avg")); // 79.66666667 + } +} +// [END datastore_multiple_aggregation_in_structured_query] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInStructuredQuery.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInStructuredQuery.java new file mode 100644 index 000000000..1fc0e9eda --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/MultipleAggregationsInStructuredQuery.java @@ -0,0 +1,75 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_multiple_aggregation_in_structured_query] + +import static com.google.cloud.datastore.aggregation.Aggregation.avg; +import static com.google.cloud.datastore.aggregation.Aggregation.count; +import static com.google.cloud.datastore.aggregation.Aggregation.sum; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class MultipleAggregationsInStructuredQuery { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the sales. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).set("customerId", 1).build(), + Entity.newBuilder(sales2Key).set("amount", 95).set("customerId", 1).build(), + Entity.newBuilder(sales3Key).set("amount", 55).set("customerId", 2).build()); + + EntityQuery baseQuery = Query.newEntityQueryBuilder().setKind(kind).build(); + + // Creating an aggregation query with COUNT, SUM and AVG aggregations. + AggregationQuery aggregationQuery = + Query.newAggregationQueryBuilder() + .over(baseQuery) + .addAggregation(count().as("total_count")) + .addAggregation(sum("amount").as("sales_sum")) + .addAggregation(avg("amount").as("sales_avg")) + .build(); + + // Executing aggregation query. + AggregationResult aggregationResult = + Iterables.getOnlyElement(datastore.runAggregation(aggregationQuery)); + + System.out.printf("Total sales count: %d", aggregationResult.getLong("total_count")); // 3 + System.out.printf("Sum of sales: %d", aggregationResult.getLong("sales_sum")); // 239 + System.out.printf( + "Avg of sales: %.8f", aggregationResult.getDouble("sales_avg")); // 79.66666667 + } +} +// [END datastore_multiple_aggregation_in_structured_query] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationOnKind.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationOnKind.java new file mode 100644 index 000000000..48ca2974d --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationOnKind.java @@ -0,0 +1,76 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_sum_aggregation_query_on_kind] + +import static com.google.cloud.datastore.aggregation.Aggregation.sum; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class SumAggregationOnKind { + + // Instantiates a client. + private static final Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + private static final String kind = "Sales"; + + // Setting up Sales in database + private static void setUpSales() { + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the sales. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).build(), + Entity.newBuilder(sales2Key).set("amount", 95).build(), + Entity.newBuilder(sales3Key).set("amount", 55).build()); + } + + // Accessing aggregation result by the provided custom alias. + private static void usageWithCustomAlias() { + EntityQuery selectAllSales = Query.newEntityQueryBuilder().setKind(kind).build(); + // Creating an aggregation query to get the sum of all sales. + AggregationQuery sumOfSalesQuery = + Query.newAggregationQueryBuilder() + .over(selectAllSales) + // passing 'total_sales_amount' as alias in the aggregation query. + .addAggregation(sum("amount").as("total_sales_amount")) + .build(); + // Executing aggregation query. + AggregationResult aggregationResult = + Iterables.getOnlyElement(datastore.runAggregation(sumOfSalesQuery)); + + System.out.printf("Total sales is %d", aggregationResult.getLong("total_sales_amount")); // 239 + } + + public static void invoke() { + setUpSales(); + usageWithCustomAlias(); + } +} +// [END datastore_sum_aggregation_query_on_kind] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithLimit.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithLimit.java new file mode 100644 index 000000000..6b94ade92 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithLimit.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 + * + * 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.datastore.aggregation; + +// [START datastore_sum_aggregation_query_with_limit] + +import static com.google.cloud.datastore.aggregation.Aggregation.sum; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class SumAggregationWithLimit { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the tasks. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).build(), + Entity.newBuilder(sales2Key).set("amount", 95).build(), + Entity.newBuilder(sales3Key).set("amount", 55).build()); + + EntityQuery selectAllSales = Query.newEntityQueryBuilder().setKind(kind).setLimit(2).build(); + // Creating an aggregation query to get the sum of all sales amount. + AggregationQuery sumOfSalesQuery = + Query.newAggregationQueryBuilder() + .over(selectAllSales) + .addAggregation(sum("amount").as("at_least")) + .build(); + // Executing aggregation query. + AggregationResult limitQueryResult = + Iterables.getOnlyElement(datastore.runAggregation(sumOfSalesQuery)); + + System.out.printf( + "We have a minimum sales sum of %d.", limitQueryResult.getLong("at_least")); // 144 + } +} +// [END datastore_sum_aggregation_query_with_limit] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithOrderBy.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithOrderBy.java new file mode 100644 index 000000000..151bdd1c7 --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithOrderBy.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 + * + * 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.datastore.aggregation; + +// [START datastore_sum_aggregation_query_with_order_by] + +import static com.google.cloud.datastore.StructuredQuery.OrderBy.asc; +import static com.google.cloud.datastore.aggregation.Aggregation.sum; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.common.collect.Iterables; + +public class SumAggregationWithOrderBy { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the sales. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).set("customerId", 1).build(), + // customerId not specified (orphan record). + Entity.newBuilder(sales2Key).set("amount", 95).build(), + Entity.newBuilder(sales3Key).set("amount", 55).set("customerId", 2).build()); + + // OrderBy acts as an existence filter. + EntityQuery selectAllSales = + Query.newEntityQueryBuilder().setKind(kind).addOrderBy(asc("customerId")).build(); + + // Creating an aggregation query to sum of all sales. + AggregationQuery sumOfSalesQuery = + Query.newAggregationQueryBuilder() + .over(selectAllSales) + .addAggregation(sum("amount").as("total_sales")) + .build(); + // Executing aggregation query. + AggregationResult limitQueryResult = + Iterables.getOnlyElement(datastore.runAggregation(sumOfSalesQuery)); + + System.out.printf( + "Total sum of %d with valid customerId field", + limitQueryResult.getLong("total_sales")); // 144 + } +} +// [END datastore_sum_aggregation_query_with_order_by] diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithPropertyFilter.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithPropertyFilter.java new file mode 100644 index 000000000..39ba310ea --- /dev/null +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/SumAggregationWithPropertyFilter.java @@ -0,0 +1,74 @@ +/* + * 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.datastore.aggregation; + +// [START datastore_sum_aggregation_query_with_filters] + +import static com.google.cloud.datastore.aggregation.Aggregation.sum; + +import com.google.cloud.datastore.AggregationQuery; +import com.google.cloud.datastore.AggregationResult; +import com.google.cloud.datastore.Datastore; +import com.google.cloud.datastore.DatastoreOptions; +import com.google.cloud.datastore.Entity; +import com.google.cloud.datastore.EntityQuery; +import com.google.cloud.datastore.Key; +import com.google.cloud.datastore.Query; +import com.google.cloud.datastore.StructuredQuery.PropertyFilter; +import com.google.common.collect.Iterables; + +public class SumAggregationWithPropertyFilter { + + public static void invoke() { + // Instantiates a client. + Datastore datastore = DatastoreOptions.getDefaultInstance().getService(); + + // The kind for the new entity. + String kind = "Sales"; + + Key sales1Key = datastore.newKeyFactory().setKind(kind).newKey("sales1"); + Key sales2Key = datastore.newKeyFactory().setKind(kind).newKey("sales2"); + Key sales3Key = datastore.newKeyFactory().setKind(kind).newKey("sales3"); + + // Save all the tasks. + datastore.put( + Entity.newBuilder(sales1Key).set("amount", 89).set("customerId", 1).build(), + Entity.newBuilder(sales2Key).set("amount", 95).set("customerId", 1).build(), + Entity.newBuilder(sales3Key).set("amount", 55).set("customerId", 2).build()); + + EntityQuery customer1Sales = + Query.newEntityQueryBuilder() + .setKind(kind) + .setFilter(PropertyFilter.eq("customerId", 1)) + .build(); + + // Creating an aggregation query to get the sum of all sales for customerId 1. + AggregationQuery customer1SalesSum = + Query.newAggregationQueryBuilder() + .over(customer1Sales) + .addAggregation(sum("amount").as("total_sales")) + .build(); + + // Executing aggregation query. + AggregationResult customer1SalesSumQueryResult = + Iterables.getOnlyElement(datastore.runAggregation(customer1SalesSum)); + + System.out.printf( + "Customer 1 sales sum is %d", customer1SalesSumQueryResult.getLong("total_sales")); // 184 + } +} +// [END datastore_sum_aggregation_query_with_filters] diff --git a/samples/snippets/src/test/java/com/example/datastore/AggregationQuerySampleTestIT.java b/samples/snippets/src/test/java/com/example/datastore/AggregationQuerySampleTestIT.java index 662802e51..ab709f575 100644 --- a/samples/snippets/src/test/java/com/example/datastore/AggregationQuerySampleTestIT.java +++ b/samples/snippets/src/test/java/com/example/datastore/AggregationQuerySampleTestIT.java @@ -18,6 +18,10 @@ import static org.junit.Assert.assertThrows; +import com.example.datastore.aggregation.AvgAggregationOnKind; +import com.example.datastore.aggregation.AvgAggregationWithLimit; +import com.example.datastore.aggregation.AvgAggregationWithOrderBy; +import com.example.datastore.aggregation.AvgAggregationWithPropertyFilter; import com.example.datastore.aggregation.CountAggregationInTransaction; import com.example.datastore.aggregation.CountAggregationOnKind; import com.example.datastore.aggregation.CountAggregationWithGqlQuery; @@ -25,6 +29,12 @@ import com.example.datastore.aggregation.CountAggregationWithOrderBy; import com.example.datastore.aggregation.CountAggregationWithPropertyFilter; import com.example.datastore.aggregation.CountAggregationWithStaleRead; +import com.example.datastore.aggregation.MultipleAggregationsInGqlQuery; +import com.example.datastore.aggregation.MultipleAggregationsInStructuredQuery; +import com.example.datastore.aggregation.SumAggregationOnKind; +import com.example.datastore.aggregation.SumAggregationWithLimit; +import com.example.datastore.aggregation.SumAggregationWithOrderBy; +import com.example.datastore.aggregation.SumAggregationWithPropertyFilter; import com.google.cloud.datastore.Datastore; import com.google.cloud.datastore.DatastoreOptions; import com.google.cloud.datastore.Key; @@ -98,4 +108,68 @@ public void testAggregationQueryAndCountWithTransaction() throws InterruptedExce assertThrows(Exception.class, CountAggregationInTransaction::invoke); systemsOutRule.assertContains("Found existing 2 tasks, rolling back"); } + + @Test + public void testSumAggregationWithKind() { + SumAggregationOnKind.invoke(); + systemsOutRule.assertContains("Total sales is 239"); + } + + @Test + public void testAvgAggregationWithKind() { + AvgAggregationOnKind.invoke(); + systemsOutRule.assertContains("Average sales is 79.66666667"); + } + + @Test + public void testSumAggregationWithPropertyFilter() { + SumAggregationWithPropertyFilter.invoke(); + systemsOutRule.assertContains("Customer 1 sales sum is 184"); + } + + @Test + public void testAvgAggregationWithPropertyFilter() { + AvgAggregationWithPropertyFilter.invoke(); + systemsOutRule.assertContains("Customer 1 sales avg is 92"); + } + + @Test + public void testSumAggregationWithLimit() { + SumAggregationWithLimit.invoke(); + systemsOutRule.assertContains("We have a minimum sales sum of 144."); + } + + @Test + public void testAvgAggregationWithLimit() { + AvgAggregationWithLimit.invoke(); + systemsOutRule.assertContains("Average with limit 2 is 72."); + } + + @Test + public void testSumAggregationWithOrderBy() { + SumAggregationWithOrderBy.invoke(); + systemsOutRule.assertContains("Total sum of 144 with valid customerId field"); + } + + @Test + public void testAvgAggregationWithOrderBy() { + AvgAggregationWithOrderBy.invoke(); + systemsOutRule.assertContains("Total avg of 72 with valid customerId field"); + } + + @Test + public void testMultipleAggregationsInStructuredQuery() { + MultipleAggregationsInStructuredQuery.invoke(); + systemsOutRule.assertContains("Total sales count: 3"); + systemsOutRule.assertContains("Sum of sales: 239"); + systemsOutRule.assertContains("Avg of sales: 79.66666667"); + } + + @Test + public void testMultipleAggregationsInGQLQuery() { + MultipleAggregationsInGqlQuery.invoke(); + systemsOutRule.assertContains("Total sales count: 3"); + systemsOutRule.assertContains("Sum of sales: 239"); + systemsOutRule.assertContains("Avg of sales: 79.66666667"); + } } diff --git a/samples/snippets/src/test/resources/index.yaml b/samples/snippets/src/test/resources/index.yaml new file mode 100644 index 000000000..50ab1ca0f --- /dev/null +++ b/samples/snippets/src/test/resources/index.yaml @@ -0,0 +1,21 @@ +# 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. + +# one time index creation is required to run AggregationQuerySampleTestIT +# see https://cloud.google.com/sdk/gcloud/reference/datastore/indexes/create for more details +indexes: +- kind: Sales + properties: + - name: customerId + - name: amount From 567697e8d5fdfd4516ed5f92f48a0a36c94d2646 Mon Sep 17 00:00:00 2001 From: Prateek Date: Wed, 30 Aug 2023 02:17:57 +0530 Subject: [PATCH 4/8] samples(fix): correcting aggregation value in comment in Avg aggregation sample (#1179) --- .../datastore/aggregation/AvgAggregationWithPropertyFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java index f41b193bc..4fe2dd532 100644 --- a/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java +++ b/samples/snippets/src/main/java/com/example/datastore/aggregation/AvgAggregationWithPropertyFilter.java @@ -68,7 +68,7 @@ public static void invoke() { Iterables.getOnlyElement(datastore.runAggregation(customer1SalesAvg)); System.out.printf( - "Customer 1 sales avg is %d", customer1SalesAvgQueryResult.getLong("total_sales")); // 184 + "Customer 1 sales avg is %d", customer1SalesAvgQueryResult.getLong("total_sales")); // 92 } } // [END datastore_avg_aggregation_query_with_filters] From 3e62380ae2793437aa9c4d21fa4484a8896cb49e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 30 Aug 2023 16:25:15 +0200 Subject: [PATCH 5/8] deps: update dependency org.easymock:easymock to v5.2.0 (#1180) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a4d405aa6..9692ca7f7 100644 --- a/pom.xml +++ b/pom.xml @@ -197,7 +197,7 @@ org.easymock easymock - 5.1.0 + 5.2.0 test From 6cbb79589e7eb8648c734bd02579a93423aa4e13 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 11 Sep 2023 06:41:00 +0200 Subject: [PATCH 6/8] deps: update dependency com.google.cloud:google-cloud-shared-dependencies to v3.15.0 (#1184) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9692ca7f7..58551e78f 100644 --- a/pom.xml +++ b/pom.xml @@ -151,7 +151,7 @@ com.google.cloud google-cloud-shared-dependencies - 3.14.0 + 3.15.0 pom import From 252f8549895250ced3aecf5c082cb0b41ea12472 Mon Sep 17 00:00:00 2001 From: Prateek Date: Mon, 11 Sep 2023 20:17:16 +0530 Subject: [PATCH 7/8] docs: Marking AggregationResult#get as Obsolete (#1185) --- .../java/com/google/cloud/datastore/AggregationResult.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/AggregationResult.java b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/AggregationResult.java index 75636c004..a5071d8d8 100644 --- a/google-cloud-datastore/src/main/java/com/google/cloud/datastore/AggregationResult.java +++ b/google-cloud-datastore/src/main/java/com/google/cloud/datastore/AggregationResult.java @@ -15,9 +15,7 @@ */ package com.google.cloud.datastore; -import static com.google.cloud.datastore.ValueType.DOUBLE; -import static com.google.cloud.datastore.ValueType.LONG; - +import com.google.api.core.ObsoleteApi; import com.google.common.base.MoreObjects; import com.google.common.base.MoreObjects.ToStringHelper; import java.util.Map; @@ -41,6 +39,7 @@ public AggregationResult(Map> properties) { * 'property_\d' * @return An aggregation result value for the given alias. */ + @ObsoleteApi("Please use getLong(String) instead, see Github issue #1175 for details.") public Long get(String alias) { return getLong(alias); } From c294e111670bc85d0f297d035a304c83590753f5 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:02:18 +0000 Subject: [PATCH 8/8] chore(main): release 2.17.1 (#1181) :robot: I have created a release *beep* *boop* --- ## [2.17.1](https://togithub.com/googleapis/java-datastore/compare/v2.17.0...v2.17.1) (2023-09-11) ### Dependencies * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.15.0 ([#1184](https://togithub.com/googleapis/java-datastore/issues/1184)) ([6cbb795](https://togithub.com/googleapis/java-datastore/commit/6cbb79589e7eb8648c734bd02579a93423aa4e13)) * Update dependency org.easymock:easymock to v5.2.0 ([#1180](https://togithub.com/googleapis/java-datastore/issues/1180)) ([3e62380](https://togithub.com/googleapis/java-datastore/commit/3e62380ae2793437aa9c4d21fa4484a8896cb49e)) ### Documentation * Marking AggregationResult#get as Obsolete ([#1185](https://togithub.com/googleapis/java-datastore/issues/1185)) ([252f854](https://togithub.com/googleapis/java-datastore/commit/252f8549895250ced3aecf5c082cb0b41ea12472)) --- 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 | 13 +++++++++++++ datastore-v1-proto-client/pom.xml | 4 ++-- google-cloud-datastore-bom/pom.xml | 10 +++++----- google-cloud-datastore/pom.xml | 4 ++-- grpc-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- pom.xml | 12 ++++++------ proto-google-cloud-datastore-admin-v1/pom.xml | 4 ++-- proto-google-cloud-datastore-v1/pom.xml | 4 ++-- samples/snapshot/pom.xml | 2 +- versions.txt | 12 ++++++------ 10 files changed, 41 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b036ad58c..9f235cfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [2.17.1](https://github.com/googleapis/java-datastore/compare/v2.17.0...v2.17.1) (2023-09-11) + + +### Dependencies + +* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.15.0 ([#1184](https://github.com/googleapis/java-datastore/issues/1184)) ([6cbb795](https://github.com/googleapis/java-datastore/commit/6cbb79589e7eb8648c734bd02579a93423aa4e13)) +* Update dependency org.easymock:easymock to v5.2.0 ([#1180](https://github.com/googleapis/java-datastore/issues/1180)) ([3e62380](https://github.com/googleapis/java-datastore/commit/3e62380ae2793437aa9c4d21fa4484a8896cb49e)) + + +### Documentation + +* Marking AggregationResult#get as Obsolete ([#1185](https://github.com/googleapis/java-datastore/issues/1185)) ([252f854](https://github.com/googleapis/java-datastore/commit/252f8549895250ced3aecf5c082cb0b41ea12472)) + ## [2.17.0](https://github.com/googleapis/java-datastore/compare/v2.16.3...v2.17.0) (2023-08-22) diff --git a/datastore-v1-proto-client/pom.xml b/datastore-v1-proto-client/pom.xml index 7563b3356..a693fcb34 100644 --- a/datastore-v1-proto-client/pom.xml +++ b/datastore-v1-proto-client/pom.xml @@ -19,12 +19,12 @@ 4.0.0 com.google.cloud.datastore datastore-v1-proto-client - 2.17.1-SNAPSHOT + 2.17.1 com.google.cloud google-cloud-datastore-parent - 2.17.1-SNAPSHOT + 2.17.1 jar diff --git a/google-cloud-datastore-bom/pom.xml b/google-cloud-datastore-bom/pom.xml index 68c5f1d83..34a7e2b19 100644 --- a/google-cloud-datastore-bom/pom.xml +++ b/google-cloud-datastore-bom/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.google.cloud google-cloud-datastore-bom - 2.17.1-SNAPSHOT + 2.17.1 pom com.google.cloud @@ -52,22 +52,22 @@ com.google.cloud google-cloud-datastore - 2.17.1-SNAPSHOT + 2.17.1 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.17.1-SNAPSHOT + 2.17.1 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.108.1-SNAPSHOT + 0.108.1 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/google-cloud-datastore/pom.xml b/google-cloud-datastore/pom.xml index ed5e8557c..a1619a509 100644 --- a/google-cloud-datastore/pom.xml +++ b/google-cloud-datastore/pom.xml @@ -2,7 +2,7 @@ 4.0.0 google-cloud-datastore - 2.17.1-SNAPSHOT + 2.17.1 jar Google Cloud Datastore https://github.com/googleapis/java-datastore @@ -12,7 +12,7 @@ com.google.cloud google-cloud-datastore-parent - 2.17.1-SNAPSHOT + 2.17.1 google-cloud-datastore diff --git a/grpc-google-cloud-datastore-admin-v1/pom.xml b/grpc-google-cloud-datastore-admin-v1/pom.xml index f47c8d6ec..0d4643da7 100644 --- a/grpc-google-cloud-datastore-admin-v1/pom.xml +++ b/grpc-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.17.1-SNAPSHOT + 2.17.1 grpc-google-cloud-datastore-admin-v1 GRPC library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/pom.xml b/pom.xml index 58551e78f..bba6d9fa5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.google.cloud google-cloud-datastore-parent pom - 2.17.1-SNAPSHOT + 2.17.1 Google Cloud Datastore Parent https://github.com/googleapis/java-datastore @@ -159,27 +159,27 @@ com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.17.1-SNAPSHOT + 2.17.1 com.google.api.grpc grpc-google-cloud-datastore-admin-v1 - 2.17.1-SNAPSHOT + 2.17.1 com.google.cloud google-cloud-datastore - 2.17.1-SNAPSHOT + 2.17.1 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.108.1-SNAPSHOT + 0.108.1 com.google.cloud.datastore datastore-v1-proto-client - 2.17.1-SNAPSHOT + 2.17.1 com.google.api.grpc diff --git a/proto-google-cloud-datastore-admin-v1/pom.xml b/proto-google-cloud-datastore-admin-v1/pom.xml index 0d19ac6ce..55665d8a5 100644 --- a/proto-google-cloud-datastore-admin-v1/pom.xml +++ b/proto-google-cloud-datastore-admin-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-admin-v1 - 2.17.1-SNAPSHOT + 2.17.1 proto-google-cloud-datastore-admin-v1 Proto library for google-cloud-datastore com.google.cloud google-cloud-datastore-parent - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/proto-google-cloud-datastore-v1/pom.xml b/proto-google-cloud-datastore-v1/pom.xml index 4c8e36bf8..77305438f 100644 --- a/proto-google-cloud-datastore-v1/pom.xml +++ b/proto-google-cloud-datastore-v1/pom.xml @@ -4,13 +4,13 @@ 4.0.0 com.google.api.grpc proto-google-cloud-datastore-v1 - 0.108.1-SNAPSHOT + 0.108.1 proto-google-cloud-datastore-v1 PROTO library for proto-google-cloud-datastore-v1 com.google.cloud google-cloud-datastore-parent - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/samples/snapshot/pom.xml b/samples/snapshot/pom.xml index 689b85ccd..81807f24a 100644 --- a/samples/snapshot/pom.xml +++ b/samples/snapshot/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-datastore - 2.17.1-SNAPSHOT + 2.17.1 diff --git a/versions.txt b/versions.txt index 052c90720..fbfda5a27 100644 --- a/versions.txt +++ b/versions.txt @@ -1,9 +1,9 @@ # Format: # module:released-version:current-version -google-cloud-datastore:2.17.0:2.17.1-SNAPSHOT -google-cloud-datastore-bom:2.17.0:2.17.1-SNAPSHOT -proto-google-cloud-datastore-v1:0.108.0:0.108.1-SNAPSHOT -datastore-v1-proto-client:2.17.0:2.17.1-SNAPSHOT -proto-google-cloud-datastore-admin-v1:2.17.0:2.17.1-SNAPSHOT -grpc-google-cloud-datastore-admin-v1:2.17.0:2.17.1-SNAPSHOT +google-cloud-datastore:2.17.1:2.17.1 +google-cloud-datastore-bom:2.17.1:2.17.1 +proto-google-cloud-datastore-v1:0.108.1:0.108.1 +datastore-v1-proto-client:2.17.1:2.17.1 +proto-google-cloud-datastore-admin-v1:2.17.1:2.17.1 +grpc-google-cloud-datastore-admin-v1:2.17.1:2.17.1