Enum Class AggregateFunction
- All Implemented Interfaces:
Serializable, Comparable<AggregateFunction>, Constable
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));
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCounts the rows in the group, nulls included.Keeps the largest non-null input value, compared withComparable.Keeps the smallest non-null input value, compared withComparable.Sums the non-null input values. -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregateFunctionReturns the enum constant of this class with the specified name.static AggregateFunction[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
Sums the non-null input values. Integral inputs accumulate exactly, floating point inputs asdouble, and decimal inputs asBigDecimal. An all-null group yields null. The output keeps the input column's type unless the aggregation declares another type. -
MIN
Keeps the smallest non-null input value, compared withComparable. An all-null group yields null. -
MAX
Keeps the largest non-null input value, compared withComparable. An all-null group yields null.
-
-
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
-