Module com.darkcollective.relix.ast
Package com.darkcollective.relix.ast
Enum Class AggregateOperator
- All Implemented Interfaces:
Serializable,Comparable<AggregateOperator>,Constable
Aggregate function operators used in
AggregateFunction.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionReturns a companion column's value from the row that maximises the ranking column — the "argmax" reduction.The minimising counterpart ofARGMAX—ARGMIN(rank, yield)yields theyieldcolumn value from the row whoserankcolumn is smallest.Average (mean) of values in a group.Gathers every value in a group into an array, in row order (the NEST /array_agg/ Mongo$pushoperation).Count of rows (or non-null values) in a group.Maximum value in a group.Minimum value in a group.Sum of values in a group. -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregateOperatorReturns the enum constant of this class with the specified name.static AggregateOperator[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUM
Sum of values in a group. -
AVG
Average (mean) of values in a group. -
COUNT
Count of rows (or non-null values) in a group. -
MIN
Minimum value in a group. -
MAX
Maximum value in a group. -
COLLECT
Gathers every value in a group into an array, in row order (the NEST /array_agg/ Mongo$pushoperation). Unlike the scalar reducers above,COLLECTproduces a nested array-valued output column — the inverse ofUNNEST. It is how a query produces nested output. -
ARGMAX
Returns a companion column's value from the row that maximises the ranking column — the "argmax" reduction. WrittenARGMAX(rank, yield): within each group it finds the row whoserankcolumn is largest and yields that row'syieldcolumn value (theyield expression).This is the row-with-the-maximum / "groupwise maximum" operation that SQL expresses only awkwardly (a window function plus a filter, or a self-join back to a
MAXsubquery). Ties resolve to the first such row in input order; rows with a null rank are ignored; an empty group yields null. LikeCOLLECTit has no portable SQL spelling, so it is never pushed down. -
ARGMIN
The minimising counterpart ofARGMAX—ARGMIN(rank, yield)yields theyieldcolumn value from the row whoserankcolumn is smallest.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-