www.espertech.comDocumentation

Chapter 13. EPL Reference: Aggregation Methods

13.1. Overview
13.2. How to Use
13.2.1. Syntax
13.2.2. Use with Aggregation Function
13.2.3. Use with Table Column
13.2.4. Using Dot to Obtain Property Values
13.2.5. Using Dot to Enumerate Events
13.3. Aggregation Methods for Sorted Aggregations
13.3.1. Overview
13.3.2. Specifying Composite Keys
13.3.3. CeilingEvent, FloorEvent, HigherEvent, LowerEvent, GetEvent
13.3.4. CeilingEvents, FloorEvents, HigherEvents, LowerEvents, GetEvents
13.3.5. CeilingKey, FloorKey, HigherKey, LowerKey
13.3.6. FirstEvent, LastEvent, MinBy, MaxBy
13.3.7. FirstEvents, LastEvents
13.3.8. FirstKey, LastKey
13.3.9. ContainsKey
13.3.10. CountEvents
13.3.11. CountKeys
13.3.12. EventsBetween
13.3.13. Submap
13.3.14. NavigableMapReference
13.4. Aggregation Methods for Window Aggregations
13.4.1. Overview
13.4.2. CountEvents
13.4.3. ListReference
13.4.4. First, Last
13.5. Aggregation Methods for CountMinSketch Aggregations
13.6. Aggregation Methods for Custom Plug-In Multi-Function Aggregations

Aggregation methods are methods that work with aggregations to perform lookups into aggregation state.

Aggregation methods are stateless and the use of aggregation methods alone does not cause the runtime to retain any events or other state.

There are four types of aggregations that offer aggregation methods:

Aggregation methods are handy when an aggregation organizes events or other data for further lookup. For example, the sorted aggregation organizes events according to sort criteria and offers operations for floor, ceiling, higher and lower keys, and many other operations.

Each aggregation makes different aggregation methods available. For example, sorted provides the higherKey aggregation method. The higherKey method is only available for use with the sorted aggregation and not with the window aggregation.

You may use aggregation methods together with aggregation functions without tables, and you may use aggregation methods with table columns that hold aggregations. Further examples are provided below.

You may also use aggregation methods with enumeration methods, date-time methods and the dot-syntax to access event properties.

This table lists methods for key-up and key-down:

Table 13.1. Sorted Aggregation Methods For Key Up/Down

MethodResult
ceilingEvent(key)

Returns the first event associated with the least key greater than or equal to the given key, or null if there is no such key.

Section 13.3.3, “CeilingEvent, FloorEvent, HigherEvent, LowerEvent, GetEvent”.

ceilingEvents(key)

Returns all events associated with the least key greater than or equal to the given key, or null if there is no such key.

Section 13.3.4, “CeilingEvents, FloorEvents, HigherEvents, LowerEvents, GetEvents”.

ceilingKey(key)

Returns the least key greater than or equal to the given key, or null if there is no such key.

Section 13.3.5, “CeilingKey, FloorKey, HigherKey, LowerKey”.

floorEvent(key)

Returns the first event associated with the greatest key less than or equal to the given key, or null if there is no such key.

Section 13.3.3, “CeilingEvent, FloorEvent, HigherEvent, LowerEvent, GetEvent”.

floorEvents(key)

Returns all events associated with the greatest key less than or equal to the given key, or null if there is no such key.

Section 13.3.4, “CeilingEvents, FloorEvents, HigherEvents, LowerEvents, GetEvents”.

floorKey(key)

Returns the greatest key less than or equal to the given key, or null if there is no such key.

Section 13.3.5, “CeilingKey, FloorKey, HigherKey, LowerKey”.

higherEvent(key)

Returns the first event associated with the least key strictly greater than the given key, or null if there is no such key.

Section 13.3.3, “CeilingEvent, FloorEvent, HigherEvent, LowerEvent, GetEvent”.

higherEvents(key)

Returns all events associated with the least key strictly greater than the given key, or null if there is no such key.

Section 13.3.4, “CeilingEvents, FloorEvents, HigherEvents, LowerEvents, GetEvents”.

higherKey(key)

Returns the least key strictly greater than the given key, or null if there is no such key.

Section 13.3.5, “CeilingKey, FloorKey, HigherKey, LowerKey”.

lowerEvent(key)

Returns the first event associated with the greatest key strictly less than the given key, or null if there is no such key.

Section 13.3.3, “CeilingEvent, FloorEvent, HigherEvent, LowerEvent, GetEvent”.

lowerEvents(key)

Returns all events associated with the greatest key strictly less than the given key, or null if there is no such key.

Section 13.3.4, “CeilingEvents, FloorEvents, HigherEvents, LowerEvents, GetEvents”.

lowerKey(key)

Returns the greatest key strictly less than the given key, or null if there is no such key.

Section 13.3.5, “CeilingKey, FloorKey, HigherKey, LowerKey”.


This table lists methods for least and greatest:


This table lists methods for getting for specific keys, checking contains and getting counts:


This table lists methods for sub-map, between-values and reference:


The aggregation methods for count-min sketch are countMinSketchFrequency and countMinSketchTopk and are already described in Section 10.2.3, “Approximation Aggregation Functions”.

The extension code defines the aggregation methods and their parameters. For more information please see Section 22.5.2, “Aggregation Multi-Function Development”.