Class: Google::Cloud::Datastore::V1::AggregationQuery::Aggregation

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/datastore/v1/query.rb

Overview

Defines a aggregation that produces a single result.

Defined Under Namespace

Classes: Count

Instance Attribute Summary collapse

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_UP_TO(4)
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_UP_TO(4) AS property_2
OVER (
  ...
);

Requires:

Returns:

  • (::String)

    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_UP_TO(4)
    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_UP_TO(4) AS property_2
    OVER (
      ...
    );
    

    Requires:



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'proto_docs/google/datastore/v1/query.rb', line 173

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.



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'proto_docs/google/datastore/v1/query.rb', line 173

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