GroupByAggregation#

public final class GroupByAggregation#

An aggregation that can be used for a reduce.

Method Summary

argMax()

Index of max element.

argMin()

Index of min element.

bitAnd()

Bitwise AND aggregation, computing the bitwise AND of all non-null values in a group.

bitOr()

Bitwise OR aggregation, computing the bitwise OR of all non-null values in a group.

bitXor()

Bitwise XOR aggregation, computing the bitwise XOR of all non-null values in a group.

collectList()

Collect the values into a list.

collectList(NullPolicy nullPolicy)

Collect the values into a list.

collectSet()

Collect the values into a set.

collectSet(NullPolicy nullPolicy, NullEquality nullEquality, NaNEquality nanEquality)

Collect the values into a set.

count()

Count number of valid, a.k.a.

count(NullPolicy nullPolicy)

Count number of elements.

createTDigest(int delta)

Compute a t-digest from on a fixed-width numeric input column.

equals(Object other)

hashCode()

histogram()

Histogram aggregation, computing the frequencies for each unique row.

hostUDF(HostUDFWrapper wrapper)

Execute an aggregation using a host-side user-defined function (UDF).

M2()

Sum of square of differences from mean.

max()

Max Aggregation.

mean()

Arithmetic mean reduction.

median()

Median reduction.

mergeHistogram()

MergeHistogram aggregation, to merge multiple histograms.

mergeLists()

Merge the partial lists produced by multiple CollectListAggregations.

mergeM2()

Merge the partial M2 values produced by multiple instances of M2Aggregation.

mergeSets()

Merge the partial sets produced by multiple CollectSetAggregations.

mergeSets(NullEquality nullEquality, NaNEquality nanEquality)

Merge the partial sets produced by multiple CollectSetAggregations.

mergeTDigest(int delta)

Merge t-digests.

min()

Min Aggregation.

nth(int offset)

Get the nth, non-null, element in a group.

nth(int offset, NullPolicy nullPolicy)

Get the nth element in a group.

nunique()

Number of unique, non-null, elements.

nunique(NullPolicy nullPolicy)

Number of unique elements.

onColumn(int columnIndex)

Add a column to the Aggregation so it can be used on a specific column of data.

product()

Product Aggregation.

quantile(QuantileMethod method, double ... quantiles)

Aggregate to compute various quantiles.

quantile(double ... quantiles)

Aggregate to compute the specified quantiles.

standardDeviation()

Standard deviation aggregation with 1 as the delta degrees of freedom.

standardDeviation(int ddof)

Standard deviation aggregation.

sum()

Sum Aggregation.

sumOverflow()

Sum aggregation that also reports per-group overflow.

variance()

Variance aggregation with 1 as the delta degrees of freedom.

variance(int ddof)

Variance aggregation.

Methods

public GroupByAggregationOnColumn onColumn(int columnIndex)#

Add a column to the Aggregation so it can be used on a specific column of data.

Parameters:

columnIndex – the index of the column to operate on.

public int hashCode()#
public boolean equals(Object other)#

Static Methods

public static GroupByAggregation count()#

Count number of valid, a.k.a.

non-null, elements.

public static GroupByAggregation count(NullPolicy nullPolicy)#

Count number of elements.

Parameters:

nullPolicy – INCLUDE if nulls should be counted. EXCLUDE if only non-null values should be counted.

public static GroupByAggregation sum()#

Sum Aggregation.

public static GroupByAggregation sumOverflow()#

Sum aggregation that also reports per-group overflow.

The result column is a STRUCT with children {sum: input-type, overflow: BOOL8}. Supported input types are signed integers (INT8/16/32/64) and fixed-point decimal (DECIMAL32/64/128). The sum-child has the same type AND scale as the input column – e.g. a DECIMAL64 input at scale -4 produces a DECIMAL64 sum-child at scale -4; cudf does not widen or rescale. On overflow the sum value is unspecified; the boolean flag is the source of truth. Both the hash-based and sort-based groupby paths are supported.

public static GroupByAggregation product()#

Product Aggregation.

public static GroupByAggregation argMax()#

Index of max element.

Please note that when using this aggregation if the data is not already sorted by the grouping keys it may be automatically sorted prior to doing the aggregation. This would result in an index into the sorted data being returned.

public static GroupByAggregation argMin()#

Index of min element.

Please note that when using this aggregation if the data is not already sorted by the grouping keys it may be automatically sorted prior to doing the aggregation. This would result in an index into the sorted data being returned.

public static GroupByAggregation min()#

Min Aggregation.

public static GroupByAggregation max()#

Max Aggregation.

public static GroupByAggregation mean()#

Arithmetic mean reduction.

public static GroupByAggregation M2()#

Sum of square of differences from mean.

public static GroupByAggregation variance()#

Variance aggregation with 1 as the delta degrees of freedom.

public static GroupByAggregation 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 GroupByAggregation standardDeviation()#

Standard deviation aggregation with 1 as the delta degrees of freedom.

public static GroupByAggregation 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 GroupByAggregation quantile(double ... quantiles)#

Aggregate to compute the specified quantiles.

Uses linear interpolation by default.

public static GroupByAggregation quantile(
QuantileMethod method,
double ... quantiles
)#

Aggregate to compute various quantiles.

public static GroupByAggregation median()#

Median reduction.

public static GroupByAggregation nunique()#

Number of unique, non-null, elements.

public static GroupByAggregation 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 GroupByAggregation 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 GroupByAggregation 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 GroupByAggregation collectList()#

Collect the values into a list.

Nulls will be skipped.

public static GroupByAggregation collectList(NullPolicy nullPolicy)#

Collect the values into a list.

Parameters:

nullPolicy – Indicates whether to include/exclude nulls during collection.

public static GroupByAggregation collectSet()#

Collect the values into a set.

All null values will be excluded, and all NaN values are regarded as unique instances.

public static GroupByAggregation 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 GroupByAggregation 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 GroupByAggregation mergeSets()#

Merge the partial sets produced by multiple CollectSetAggregations.

Each null/NaN value will be regarded as a unique instance.

public static GroupByAggregation hostUDF(HostUDFWrapper wrapper)#

Execute an aggregation using a host-side user-defined function (UDF).

Parameters:

wrapper – The wrapper for the native host UDF instance.

Returns:

A new GroupByAggregation instance

public static GroupByAggregation 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 GroupByAggregation mergeM2()#

Merge the partial M2 values produced by multiple instances of M2Aggregation.

public static GroupByAggregation createTDigest(int delta)#

Compute a t-digest from on a fixed-width numeric input column.

Parameters:

delta – Required accuracy (number of buckets).

Returns:

A list of centroids per grouping, where each centroid has a mean value and a weight. The number of centroids will be <= delta.

public static GroupByAggregation mergeTDigest(int delta)#

Merge t-digests.

Parameters:

delta – Required accuracy (number of buckets).

Returns:

A list of centroids per grouping, where each centroid has a mean value and a weight. The number of centroids will be <= delta.

public static GroupByAggregation histogram()#

Histogram aggregation, computing the frequencies for each unique row.

A histogram is given as a lists column, in which the first child stores unique rows from the input values and the second child stores their corresponding frequencies.

Returns:

A lists of structs column in which each list contains a histogram corresponding to an input key.

public static GroupByAggregation mergeHistogram()#

MergeHistogram aggregation, to merge multiple histograms.

Returns:

A new histogram in which the frequencies of the unique rows are sum up.

public static GroupByAggregation bitAnd()#

Bitwise AND aggregation, computing the bitwise AND of all non-null values in a group.

public static GroupByAggregation bitOr()#

Bitwise OR aggregation, computing the bitwise OR of all non-null values in a group.

public static GroupByAggregation bitXor()#

Bitwise XOR aggregation, computing the bitwise XOR of all non-null values in a group.