Class: Google::Cloud::Datastore::V1::AggregationQuery::Aggregation
- Inherits:
-
Object
- Object
- Google::Cloud::Datastore::V1::AggregationQuery::Aggregation
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/datastore/v1/query.rb
Overview
Defines an aggregation that produces a single result.
Defined Under Namespace
Classes: Count
Instance Attribute Summary collapse
-
#alias ⇒ ::String
Optional.
-
#count ⇒ ::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Count
Count aggregator.
Instance Attribute Details
#alias ⇒ ::String
Returns Optional. Optional name of the property to store the result of the aggregation.
If not provided, Datastore will pick a default name following the format
property_<incremental_id++>
. For example:
AGGREGATE
COUNT_UP_TO(1) AS count_up_to_1,
COUNT_UP_TO(2),
COUNT_UP_TO(3) AS count_up_to_3,
COUNT(*)
OVER (
...
);
becomes:
AGGREGATE
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(*) AS property_2
OVER (
...
);
Requires:
- Must be unique across all aggregation aliases.
- Conform to [entity property name][google.datastore.v1.Entity.properties] limitations.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'proto_docs/google/datastore/v1/query.rb', line 188 class Aggregation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Count of entities that match the query. # # The `COUNT(*)` aggregation function operates on the entire entity # so it does not require a field reference. # @!attribute [rw] up_to # @return [::Google::Protobuf::Int64Value] # Optional. Optional constraint on the maximum number of entities to # count. # # This provides a way to set an upper bound on the number of entities # to scan, limiting latency, and cost. # # Unspecified is interpreted as no bound. # # If a zero value is provided, a count result of zero should always be # expected. # # High-Level Example: # # ``` # AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); # ``` # # Requires: # # * Must be non-negative when present. class Count include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#count ⇒ ::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Count
Returns Count aggregator.
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'proto_docs/google/datastore/v1/query.rb', line 188 class Aggregation include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Count of entities that match the query. # # The `COUNT(*)` aggregation function operates on the entire entity # so it does not require a field reference. # @!attribute [rw] up_to # @return [::Google::Protobuf::Int64Value] # Optional. Optional constraint on the maximum number of entities to # count. # # This provides a way to set an upper bound on the number of entities # to scan, limiting latency, and cost. # # Unspecified is interpreted as no bound. # # If a zero value is provided, a count result of zero should always be # expected. # # High-Level Example: # # ``` # AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); # ``` # # Requires: # # * Must be non-negative when present. class Count include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |