Class ReductionAggregation

java.lang.Object
ai.rapids.cudf.ReductionAggregation

public final class ReductionAggregation extends Object
An aggregation that can be used for a reduce.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • sum

      public static ReductionAggregation sum()
      Sum Aggregation
    • product

      public static ReductionAggregation product()
      Product Aggregation.
    • min

      public static ReductionAggregation min()
      Min Aggregation
    • max

      public static ReductionAggregation max()
      Max Aggregation
    • any

      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.
    • all

      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.
    • sumOfSquares

      public static ReductionAggregation sumOfSquares()
      Sum of squares reduction.
    • mean

      public static ReductionAggregation mean()
      Arithmetic mean reduction.
    • variance

      public static ReductionAggregation variance()
      Variance aggregation with 1 as the delta degrees of freedom.
    • variance

      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.
    • standardDeviation

      public static ReductionAggregation standardDeviation()
      Standard deviation aggregation with 1 as the delta degrees of freedom.
    • standardDeviation

      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.
    • median

      public static ReductionAggregation median()
      Median reduction.
    • quantile

      public static ReductionAggregation quantile(double... quantiles)
      Aggregate to compute the specified quantiles. Uses linear interpolation by default.
    • quantile

      public static ReductionAggregation quantile(QuantileMethod method, double... quantiles)
      Aggregate to compute various quantiles.
    • nunique

      public static ReductionAggregation nunique()
      Number of unique, non-null, elements.
    • nunique

      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.
    • nth

      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.
    • nth

      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.
    • createTDigest

      public static ReductionAggregation createTDigest(int delta)
      tDigest reduction.
    • mergeTDigest

      public static ReductionAggregation mergeTDigest(int delta)
      tDigest merge reduction.
    • collectList

      public static ReductionAggregation collectList()
    • collectList

      public static ReductionAggregation collectList(NullPolicy nullPolicy)
      Collect the values into a list.
      Parameters:
      nullPolicy - Indicates whether to include/exclude nulls during collection.
    • collectSet

      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.
    • collectSet

      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.
    • mergeLists

      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).
    • mergeSets

      public static ReductionAggregation mergeSets()
      Merge the partial sets produced by multiple CollectSetAggregations. Each null/NaN value will be regarded as a unique instance.
    • mergeSets

      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.
    • hostUDF

      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
    • histogram

      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.
    • mergeHistogram

      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.
    • bitAnd

      public static ReductionAggregation bitAnd()
      Bitwise AND aggregation, computing the bitwise AND of all non-null values.
    • bitOr

      public static ReductionAggregation bitOr()
      Bitwise OR aggregation, computing the bitwise OR of all non-null values.
    • bitXor

      public static ReductionAggregation bitXor()
      Bitwise XOR aggregation, computing the bitwise XOR of all non-null values.