Enum Class ConsolidationFunction

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

public enum ConsolidationFunction extends Enum<ConsolidationFunction>
Consolidation functions for the DownsampleNode time-series aggregation operator.

Applied within each time bucket to reduce a group of input rows to a single summary value per column (or a row count for COUNT).

Each constant is named after the aggregate that performs the reduction, and that name is what the engine resolves: MIN here is the same MIN a γ computes, over the same values, with the same answer for a bucket whose values are all NULL. The enum is the operator's vocabulary — what the grammar admits after USING — not a second definition of what the reduction does.

  • 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
    Arithmetic mean of numeric column values in the bucket.
    Number of rows in the bucket; produces a single count output column.
    Largest column value in the bucket, by the engine's value order.
    Smallest column value in the bucket, by the engine's value order.
    Sum of numeric column values in the bucket.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether this reduction is about the rows themselves rather than a column's values, so a bucket yields one count column and no per-column ones.
    boolean
    Whether this reduction is defined only over numbers.
    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

    • AVG

      public static final ConsolidationFunction AVG
      Arithmetic mean of numeric column values in the bucket.
    • MIN

      public static final ConsolidationFunction MIN
      Smallest column value in the bucket, by the engine's value order.
    • MAX

      public static final ConsolidationFunction MAX
      Largest column value in the bucket, by the engine's value order.
    • SUM

      public static final ConsolidationFunction SUM
      Sum of numeric column values in the bucket.
    • COUNT

      public static final ConsolidationFunction COUNT
      Number of rows in the bucket; produces a single count output column.
  • Method Details

    • values

      public static ConsolidationFunction[] 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 ConsolidationFunction 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
    • countsRows

      public boolean countsRows()
      Whether this reduction is about the rows themselves rather than a column's values, so a bucket yields one count column and no per-column ones.
      Returns:
      true for COUNT
    • numericOnly

      public boolean numericOnly()
      Whether this reduction is defined only over numbers.

      AVG and SUM arithmetic is; MIN and MAX are comparisons, and the engine orders dates, times and strings as readily as numbers — so those two consolidate a column of any scalar type. Both the schema rule and the executor read this rather than each deciding for itself, which is what stops the inferred heading and the produced rows disagreeing.

      Returns:
      true for AVG and SUM