Skip to content

Commit d14f87e

Browse files
feat: Add SUM/AVG aggregation query support in the preview branch and improve query API documentation (#1094)
* feat: Add SUM/AVG aggregation query support in the preview branch and improve query API documentation PiperOrigin-RevId: 518940761 Source-Link: googleapis/googleapis@b1efb32 Source-Link: googleapis/googleapis-gen@f7c2054 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjdjMjA1NDE0YTVjNjU3OTQzOGI1ODA2ZDNkYzVmMjBkMDllZjgzYyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent d0998d4 commit d14f87e

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

protos/google/datastore/v1/aggregation_result.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

protos/google/datastore/v1/datastore.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

protos/google/datastore/v1/entity.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -213,7 +213,7 @@ message Entity {
213213
// The map's keys are property names.
214214
// A property name matching regex `__.*__` is reserved.
215215
// A reserved property name is forbidden in certain documented contexts.
216-
// The name must not contain more than 500 characters.
217-
// The name cannot be `""`.
216+
// The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
217+
// be empty.
218218
map<string, Value> properties = 3;
219219
}

protos/google/datastore/v1/query.proto

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -99,6 +99,11 @@ message Query {
9999
// The properties to make distinct. The query results will contain the first
100100
// result for each distinct combination of values for the given properties
101101
// (if empty, all results are returned).
102+
//
103+
// Requires:
104+
//
105+
// * If `order` is specified, the set of distinct on properties must appear
106+
// before the non-distinct on properties in `order`.
102107
repeated PropertyReference distinct_on = 6;
103108

104109
// A starting point for the query results. Query cursors are
@@ -127,7 +132,7 @@ message Query {
127132
// Datastore query for running an aggregation over a
128133
// [Query][google.datastore.v1.Query].
129134
message AggregationQuery {
130-
// Defines a aggregation that produces a single result.
135+
// Defines an aggregation that produces a single result.
131136
message Aggregation {
132137
// Count of entities that match the query.
133138
//
@@ -138,7 +143,7 @@ message AggregationQuery {
138143
// count.
139144
//
140145
// This provides a way to set an upper bound on the number of entities
141-
// to scan, limiting latency and cost.
146+
// to scan, limiting latency, and cost.
142147
//
143148
// Unspecified is interpreted as no bound.
144149
//
@@ -175,7 +180,7 @@ message AggregationQuery {
175180
// COUNT_UP_TO(1) AS count_up_to_1,
176181
// COUNT_UP_TO(2),
177182
// COUNT_UP_TO(3) AS count_up_to_3,
178-
// COUNT_UP_TO(4)
183+
// COUNT(*)
179184
// OVER (
180185
// ...
181186
// );
@@ -188,7 +193,7 @@ message AggregationQuery {
188193
// COUNT_UP_TO(1) AS count_up_to_1,
189194
// COUNT_UP_TO(2) AS property_1,
190195
// COUNT_UP_TO(3) AS count_up_to_3,
191-
// COUNT_UP_TO(4) AS property_2
196+
// COUNT(*) AS property_2
192197
// OVER (
193198
// ...
194199
// );

0 commit comments

Comments
 (0)