Enum Class AggregateFunction

java.lang.Object
java.lang.Enum<AggregateFunction>
io.krabka.streams.columnar.AggregateFunction
All Implemented Interfaces:
Serializable, Comparable<AggregateFunction>, Constable

public enum AggregateFunction extends Enum<AggregateFunction>
Built-in within-batch aggregate functions.

Used inside an Aggregation passed to BuiltinOp.groupBy(org.apache.arrow.memory.BufferAllocator, java.util.Collection, Aggregation...) or a windowed variant. Integral accumulation is exact and overflow-checked; an overflow throws ArithmeticException rather than wrapping.

Example

var totals = BuiltinOp.groupBy(
    allocator,
    List.of("user"),
    new Aggregation("amount", "total", AggregateFunction.SUM),
    new Aggregation("amount", "count", AggregateFunction.COUNT));
  • Enum Constant Details

    • COUNT

      public static final AggregateFunction COUNT
      Counts the rows in the group, nulls included. The output column is a signed 64-bit integer unless the aggregation declares another type.
    • SUM

      public static final AggregateFunction SUM
      Sums the non-null input values. Integral inputs accumulate exactly, floating point inputs as double, and decimal inputs as BigDecimal. An all-null group yields null. The output keeps the input column's type unless the aggregation declares another type.
    • MIN

      public static final AggregateFunction MIN
      Keeps the smallest non-null input value, compared with Comparable. An all-null group yields null.
    • MAX

      public static final AggregateFunction MAX
      Keeps the largest non-null input value, compared with Comparable. An all-null group yields null.
  • Method Details

    • values

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