Record Class Aggregation
java.lang.Object
java.lang.Record
io.krabka.streams.columnar.Aggregation
- Record Components:
inputColumn- the payload column the function readsoutputColumn- the name of the aggregate column in the output batchfunction- the aggregate function to applyoutputType- the Arrow type of the output column, or null for the default
public record Aggregation(String inputColumn, String outputColumn, AggregateFunction function, org.apache.arrow.vector.types.pojo.ArrowType outputType)
extends Record
Defines one aggregation, with an optional explicit output type.
Without an explicit type, AggregateFunction.COUNT outputs a signed
64-bit integer and the other functions keep the input column's type. Pass an
ArrowType to override, for example to widen a 32-bit sum column to 64 bits.
Example
var wideTotal = new Aggregation(
"amount", "total", AggregateFunction.SUM, new ArrowType.Int(64, true));
var op = BuiltinOp.groupBy(allocator, List.of("user"), wideTotal);
-
Constructor Summary
ConstructorsConstructorDescriptionAggregation(String inputColumn, String outputColumn, AggregateFunction function) Creates an aggregation with the function's default output type.Aggregation(String inputColumn, String outputColumn, AggregateFunction function, org.apache.arrow.vector.types.pojo.ArrowType outputType) Validates that everything but the output type is present. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinputColumnrecord component.Returns the value of theoutputColumnrecord component.org.apache.arrow.vector.types.pojo.ArrowTypeReturns the value of theoutputTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Aggregation
Creates an aggregation with the function's default output type.- Parameters:
inputColumn- the payload column the function readsoutputColumn- the name of the aggregate column in the output batchfunction- the aggregate function to apply
-
Aggregation
public Aggregation(String inputColumn, String outputColumn, AggregateFunction function, org.apache.arrow.vector.types.pojo.ArrowType outputType) Validates that everything but the output type is present.- Parameters:
inputColumn- the payload column the function readsoutputColumn- the name of the aggregate column in the output batchfunction- the aggregate function to applyoutputType- the Arrow type of the output column, or null for the default- Throws:
NullPointerException- ifinputColumn,outputColumn, orfunctionis null
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
inputColumn
Returns the value of theinputColumnrecord component.- Returns:
- the value of the
inputColumnrecord component
-
outputColumn
Returns the value of theoutputColumnrecord component.- Returns:
- the value of the
outputColumnrecord component
-
function
-
outputType
public org.apache.arrow.vector.types.pojo.ArrowType outputType()Returns the value of theoutputTyperecord component.- Returns:
- the value of the
outputTyperecord component
-