Enum Class AggregateOperator

java.lang.Object
java.lang.Enum<AggregateOperator>
com.darkcollective.relix.ast.AggregateOperator
All Implemented Interfaces:
Serializable, Comparable<AggregateOperator>, Constable

public enum AggregateOperator extends Enum<AggregateOperator>
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 Constants
    Enum Constant
    Description
    Returns a companion column's value from the row that maximises the ranking column — the "argmax" reduction.
    The minimising counterpart of ARGMAX — ARGMIN(rank, yield) yields the yield column value from the row whose rank column 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 $push operation).
    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 Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • SUM

      public static final AggregateOperator SUM
      Sum of values in a group.
    • AVG

      public static final AggregateOperator AVG
      Average (mean) of values in a group.
    • COUNT

      public static final AggregateOperator COUNT
      Count of rows (or non-null values) in a group.
    • MIN

      public static final AggregateOperator MIN
      Minimum value in a group.
    • MAX

      public static final AggregateOperator MAX
      Maximum value in a group.
    • COLLECT

      public static final AggregateOperator COLLECT
      Gathers every value in a group into an array, in row order (the NEST / array_agg / Mongo $push operation). Unlike the scalar reducers above, COLLECT produces a nested array-valued output column — the inverse of UNNEST. It is how a query produces nested output.
    • ARGMAX

      public static final AggregateOperator ARGMAX
      Returns a companion column's value from the row that maximises the ranking column — the "argmax" reduction. Written ARGMAX(rank, yield): within each group it finds the row whose rank column is largest and yields that row's yield column value (the yield 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 MAX subquery). Ties resolve to the first such row in input order; rows with a null rank are ignored; an empty group yields null. Like COLLECT it has no portable SQL spelling, so it is never pushed down.

    • ARGMIN

      public static final AggregateOperator ARGMIN
      The minimising counterpart of ARGMAX — ARGMIN(rank, yield) yields the yield column value from the row whose rank column is smallest.
  • Method Details

    • values

      public static AggregateOperator[] 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

      public static AggregateOperator valueOf(String name)
      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 name
      NullPointerException - if the argument is null