Skip to content

Commit

Permalink
feat: Add SUM/AVG aggregation query support in the preview branch and…
Browse files Browse the repository at this point in the history
… improve query API documentation

PiperOrigin-RevId: 518940761
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 23, 2023
1 parent f074df8 commit b1efb32
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion google/datastore/v1/aggregation_result.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion google/datastore/v1/datastore.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
5 changes: 5 additions & 0 deletions google/datastore/v1/datastore_v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ documentation:
summary: |-
Accesses the schemaless NoSQL database to provide fully managed, robust,
scalable storage for your application.
rules:
- selector: google.longrunning.Operations.ListOperations
description: |-
Lists operations that match the specified filter in the request. If
the server doesn't support this method, it returns `UNIMPLEMENTED`.
backend:
rules:
Expand Down
6 changes: 3 additions & 3 deletions google/datastore/v1/entity.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -213,7 +213,7 @@ message Entity {
// The map's keys are property names.
// A property name matching regex `__.*__` is reserved.
// A reserved property name is forbidden in certain documented contexts.
// The name must not contain more than 500 characters.
// The name cannot be `""`.
// The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
// be empty.
map<string, Value> properties = 3;
}
15 changes: 10 additions & 5 deletions google/datastore/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -99,6 +99,11 @@ message Query {
// The properties to make distinct. The query results will contain the first
// result for each distinct combination of values for the given properties
// (if empty, all results are returned).
//
// Requires:
//
// * If `order` is specified, the set of distinct on properties must appear
// before the non-distinct on properties in `order`.
repeated PropertyReference distinct_on = 6;

// A starting point for the query results. Query cursors are
Expand Down Expand Up @@ -127,7 +132,7 @@ message Query {
// Datastore query for running an aggregation over a
// [Query][google.datastore.v1.Query].
message AggregationQuery {
// Defines a aggregation that produces a single result.
// Defines an aggregation that produces a single result.
message Aggregation {
// Count of entities that match the query.
//
Expand All @@ -138,7 +143,7 @@ message AggregationQuery {
// count.
//
// This provides a way to set an upper bound on the number of entities
// to scan, limiting latency and cost.
// to scan, limiting latency, and cost.
//
// Unspecified is interpreted as no bound.
//
Expand Down Expand Up @@ -175,7 +180,7 @@ message AggregationQuery {
// COUNT_UP_TO(1) AS count_up_to_1,
// COUNT_UP_TO(2),
// COUNT_UP_TO(3) AS count_up_to_3,
// COUNT_UP_TO(4)
// COUNT(*)
// OVER (
// ...
// );
Expand All @@ -188,7 +193,7 @@ message AggregationQuery {
// COUNT_UP_TO(1) AS count_up_to_1,
// COUNT_UP_TO(2) AS property_1,
// COUNT_UP_TO(3) AS count_up_to_3,
// COUNT_UP_TO(4) AS property_2
// COUNT(*) AS property_2
// OVER (
// ...
// );
Expand Down

0 comments on commit b1efb32

Please sign in to comment.