ReductionAggregation#
- public final class ReductionAggregation#
An aggregation that can be used for a reduce.
Method Summary
All reduction.
Any reduction.
ArgMax Aggregation.
ArgMin Aggregation.
Bitwise AND aggregation, computing the bitwise AND of all non-null values.
Bitwise OR aggregation, computing the bitwise OR of all non-null values.
Bitwise XOR aggregation, computing the bitwise XOR of all non-null values.
Collect the values into a list.
Collect the values into a set.
collectSet(NullPolicy nullPolicy, NullEquality nullEquality, NaNEquality nanEquality)Collect the values into a set.
tDigest reduction.
Create HistogramAggregation, computing the frequencies for each unique row.
Execute a reduction using a host-side user-defined function (UDF).
Max Aggregation.
Arithmetic mean reduction.
Median reduction.
Create MergeHistogramAggregation, to merge multiple histograms.
Merge the partial lists produced by multiple CollectListAggregations.
Merge the partial sets produced by multiple CollectSetAggregations.
mergeSets(NullEquality nullEquality, NaNEquality nanEquality)Merge the partial sets produced by multiple CollectSetAggregations.
tDigest merge reduction.
Min Aggregation.
Get the nth, non-null, element in a group.
Get the nth element in a group.
Number of unique, non-null, elements.
Number of unique elements.
Product Aggregation.
Aggregate to compute various quantiles.
Aggregate to compute the specified quantiles.
Standard deviation aggregation with 1 as the delta degrees of freedom.
Standard deviation aggregation.
Sum Aggregation.
Sum of squares reduction.
Sum reduction that also reports overflow.
Variance aggregation with 1 as the delta degrees of freedom.
Variance aggregation.
Static Methods
- public static ReductionAggregation sum()#
Sum Aggregation.
- public static ReductionAggregation sumOverflow()#
Sum reduction that also reports overflow.
The result is a struct scalar with children {sum: same type as input, overflow: BOOL8}. The input may be any signed integer type (INT8/16/32/64) or fixed-point decimal (DECIMAL32/64/128). On overflow the sum value is unspecified; the boolean flag is the source of truth.
- public static ReductionAggregation product()#
Product Aggregation.
- public static ReductionAggregation argMin()#
ArgMin Aggregation.
- public static ReductionAggregation argMax()#
ArgMax Aggregation.
- public static ReductionAggregation min()#
Min Aggregation.
- public static ReductionAggregation max()#
Max Aggregation.
- public static ReductionAggregation any()#
Any reduction.
Produces a true or 1, depending on the output type, if any of the elements in the range are true or non-zero, otherwise produces a false or 0. Null values are skipped.
- public static ReductionAggregation all()#
All reduction.
Produces true or 1, depending on the output type, if all of the elements in the range are true or non-zero, otherwise produces a false or 0. Null values are skipped.
- public static ReductionAggregation sumOfSquares()#
Sum of squares reduction.
- public static ReductionAggregation mean()#
Arithmetic mean reduction.
- public static ReductionAggregation variance()#
Variance aggregation with 1 as the delta degrees of freedom.
- public static ReductionAggregation variance(int ddof)#
Variance aggregation.
- Parameters:
ddof – delta degrees of freedom. The divisor used in calculation of variance is
N - ddof, where N is the population size.
- public static ReductionAggregation standardDeviation()#
Standard deviation aggregation with 1 as the delta degrees of freedom.
- public static ReductionAggregation standardDeviation(int ddof)#
Standard deviation aggregation.
- Parameters:
ddof – delta degrees of freedom. The divisor used in calculation of std is
N - ddof, where N is the population size.
- public static ReductionAggregation median()#
Median reduction.
- public static ReductionAggregation quantile(double... quantiles)#
Aggregate to compute the specified quantiles.
Uses linear interpolation by default.
- public static ReductionAggregation quantile(
- QuantileMethod method,
- double... quantiles
Aggregate to compute various quantiles.
- public static ReductionAggregation nunique()#
Number of unique, non-null, elements.
- public static ReductionAggregation nunique(NullPolicy nullPolicy)#
Number of unique elements.
- Parameters:
nullPolicy – INCLUDE if nulls should be counted else EXCLUDE. If nulls are counted they compare as equal so multiple null values in a range would all only increase the count by 1.
- public static ReductionAggregation nth(int offset)#
Get the nth, non-null, element in a group.
- Parameters:
offset – the offset to look at. Negative numbers go from the end of the group. Any value outside of the group range results in a null.
- public static ReductionAggregation nth(
- int offset,
- NullPolicy nullPolicy
Get the nth element in a group.
- Parameters:
offset – the offset to look at. Negative numbers go from the end of the group. Any value outside of the group range results in a null.
nullPolicy – INCLUDE if nulls should be included in the aggregation or EXCLUDE if they should be skipped.
- public static ReductionAggregation createTDigest(int delta)#
tDigest reduction.
- public static ReductionAggregation mergeTDigest(int delta)#
tDigest merge reduction.
- public static ReductionAggregation collectList()#
- public static ReductionAggregation collectList(NullPolicy nullPolicy)#
Collect the values into a list.
- Parameters:
nullPolicy – Indicates whether to include/exclude nulls during collection.
- public static ReductionAggregation collectSet()#
Collect the values into a set.
All null values will be excluded, and all NaN values are regarded as unique instances.
- public static ReductionAggregation collectSet(
- NullPolicy nullPolicy,
- NullEquality nullEquality,
- NaNEquality nanEquality
Collect the values into a set.
- Parameters:
nullPolicy – Indicates whether to include/exclude nulls during collection.
nullEquality – Flag to specify whether null entries within each list should be considered equal.
nanEquality – Flag to specify whether NaN values in floating point column should be considered equal.
- public static ReductionAggregation mergeLists()#
Merge the partial lists produced by multiple CollectListAggregations.
NOTICE: The partial lists to be merged should NOT include any null list element (but can include null list entries).
- public static ReductionAggregation mergeSets()#
Merge the partial sets produced by multiple CollectSetAggregations.
Each null/NaN value will be regarded as a unique instance.
- public static ReductionAggregation mergeSets(
- NullEquality nullEquality,
- NaNEquality nanEquality
Merge the partial sets produced by multiple CollectSetAggregations.
- Parameters:
nullEquality – Flag to specify whether null entries within each list should be considered equal.
nanEquality – Flag to specify whether NaN values in floating point column should be considered equal.
- public static ReductionAggregation hostUDF(HostUDFWrapper wrapper)#
Execute a reduction using a host-side user-defined function (UDF).
- Parameters:
wrapper – The wrapper for the native host UDF instance.
- Returns:
A new ReductionAggregation instance
- public static ReductionAggregation histogram()#
Create HistogramAggregation, computing the frequencies for each unique row.
- Returns:
A structs column in which the first child stores unique rows from the input and the second child stores their corresponding frequencies.
- public static ReductionAggregation mergeHistogram()#
Create MergeHistogramAggregation, to merge multiple histograms.
- Returns:
A new histogram in which the frequencies of the unique rows are sum up.
- public static ReductionAggregation bitAnd()#
Bitwise AND aggregation, computing the bitwise AND of all non-null values.
- public static ReductionAggregation bitOr()#
Bitwise OR aggregation, computing the bitwise OR of all non-null values.
- public static ReductionAggregation bitXor()#
Bitwise XOR aggregation, computing the bitwise XOR of all non-null values.