aggregation_result.proto 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.datastore.v1;
  16. import "google/datastore/v1/entity.proto";
  17. import "google/datastore/v1/query.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.Datastore.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/datastore/v1;datastore";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "AggregationResultProto";
  23. option java_package = "com.google.datastore.v1";
  24. option php_namespace = "Google\\Cloud\\Datastore\\V1";
  25. option ruby_package = "Google::Cloud::Datastore::V1";
  26. // The result of a single bucket from a Datastore aggregation query.
  27. //
  28. // The keys of `aggregate_properties` are the same for all results in an
  29. // aggregation query, unlike entity queries which can have different fields
  30. // present for each result.
  31. message AggregationResult {
  32. // The result of the aggregation functions, ex: `COUNT(*) AS total_entities`.
  33. //
  34. // The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias]
  35. // assigned to the aggregation function on input and the size of this map
  36. // equals the number of aggregation functions in the query.
  37. map<string, Value> aggregate_properties = 2;
  38. }
  39. // A batch of aggregation results produced by an aggregation query.
  40. message AggregationResultBatch {
  41. // The aggregation results for this batch.
  42. repeated AggregationResult aggregation_results = 1;
  43. // The state of the query after the current batch.
  44. // Only COUNT(*) aggregations are supported in the initial launch. Therefore,
  45. // expected result type is limited to `NO_MORE_RESULTS`.
  46. QueryResultBatch.MoreResultsType more_results = 2;
  47. // Read timestamp this batch was returned from.
  48. //
  49. // In a single transaction, subsequent query result batches for the same query
  50. // can have a greater timestamp. Each batch's read timestamp
  51. // is valid for all preceding batches.
  52. google.protobuf.Timestamp read_time = 3;
  53. }