Interface Aggregation
- All Known Subinterfaces:
RollupAggregation
- All Known Implementing Classes:
Aggregations,ColumnAggregation,ColumnAggregations,Count,CountWhere,FirstRowKey,Formula,LastRowKey,NullColumns,Partition,RollupAggregationBase
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic AggregationCreate anabsolute sumaggregation for the supplied column name pairs.static AggregationAggApproxPct(double percentile, double compression, String... pairs) Create anapproximate percentileaggregation for the supplied percentile, T-Digest compression factor, and column name pairs.static AggregationAggApproxPct(double percentile, String... pairs) Create anapproximate percentileaggregation for the supplied percentile and column name pairs with the default T-Digestcompressionfactor.static AggregationAggApproxPct(String inputColumn, double compression, PercentileOutput... percentileOutputs) Create anapproximate percentileaggregation for the supplied input column name, T-Digest compression factor, and percentile/output column name pairs.static AggregationAggApproxPct(String inputColumn, PercentileOutput... percentileOutputs) Create anapproximate percentileaggregation for the supplied input column name and percentile/output column name pairs with the default T-Digestcompressionfactor.static AggregationCreate anaverage(arithmetic mean) aggregation for the supplied column name pairs.static CountCreate acountaggregation with the supplied output column name.static AggregationAggCountDistinct(boolean countNulls, String... pairs) Create acount distinctaggregation for the supplied column name pairs.static AggregationAggCountDistinct(String... pairs) Create acount distinctaggregation for the supplied column name pairs.static CountWhereAggCountWhere(String resultColumn, Filter filter) Create acountaggregation with the supplied output column name, counting values that pass the suppliedfilter.static CountWhereAggCountWhere(String resultColumn, String... filters) Create acountaggregation with the supplied output column name, counting values that pass the suppliedfilters.static AggregationAggDistinct(boolean includeNulls, String... pairs) Create adistinctaggregation for the supplied column name pairs.static AggregationAggDistinct(String... pairs) Create adistinctaggregation for the supplied column name pairs.static AggregationCreate afirstaggregation for the supplied column name pairs.static FirstRowKeyAggFirstRowKey(String resultColumn) Create afirst row keyaggregation with the supplied result column.static FormulaAggFormula(String formulaString) Create aformulaaggregation with the suppliedformula.static FormulaAggFormula(String columnName, String expression) static AggregationAggFormula(String formula, String paramToken, String... pairs) Deprecated.static AggregationCreate afreezeaggregation for the supplied column name pairs.static AggregationCreate agroupaggregation for the supplied column name pairs.static AggregationCreate alastaggregation for the supplied column name pairs.static LastRowKeyAggLastRowKey(String resultColumn) Create alast row keyaggregation with the supplied result column.static AggregationCreate amaxaggregation for the supplied column name pairs.static AggregationCreate amedianaggregation for the supplied column name pairs.static AggregationCreate amedianaggregation for the supplied column name pairs.static AggregationCreate aminaggregation for the supplied column name pairs.static PartitionAggPartition(String resultColumn) Create apartitionaggregation with the supplied output column name and group-by columns included in the output sub-tables.static PartitionAggPartition(String resultColumn, boolean includeGroupByColumns) Create apartitionaggregation with the supplied output column name.static AggregationCreate apercentileaggregation for the supplied percentile and column name pairs.static AggregationCreate apercentileaggregation for the supplied percentile and column name pairs.static AggregationAggPct(String inputColumn, boolean average, PercentileOutput... percentileOutputs) Create apercentileaggregation for the supplied input column name and percentile/output column name pairs.static AggregationAggPct(String inputColumn, PercentileOutput... percentileOutputs) Create apercentileaggregation for the supplied input column name and percentile/output column name pairs.static AggregationAggSortedFirst(String sortColumn, String... pairs) Create asorted firstaggregation for the supplied sort column name and input/output column name pairs.static AggregationAggSortedFirst(Collection<? extends String> sortColumns, String... pairs) Create asorted firstaggregation for the supplied sort column names and input/output column name pairs.static AggregationAggSortedLast(String sortColumn, String... pairs) Create asorted lastaggregation for the supplied sort column name and input/output column name pairs.static AggregationAggSortedLast(Collection<? extends String> sortColumns, String... pairs) Create asorted lastaggregation for the supplied sort column names and input/output column name pairs.static AggregationCreate asample standard deviationaggregation for the supplied column name pairs.static AggregationCreate asumaggregation for the supplied column name pairs.static AggregationAggTDigest(double compression, String... pairs) Create aT-Digestaggregation for the supplied column name pairs with the suppliedcompressionfactor.static AggregationAggTDigest(String... pairs) Create aT-Digestaggregation for the supplied column name pairs with the default T-Digestcompressionfactor.static AggregationAggUnique(boolean includeNulls, UnionObject nonUniqueSentinel, String... pairs) Create auniqueaggregation for the supplied column name pairs.static AggregationCreate auniqueaggregation for the supplied column name pairs.static AggregationCreate auniqueaggregation for the supplied column name pairs.static AggregationCreate asample varianceaggregation for the supplied column name pairs.static AggregationCreate aweighted averageaggregation for the supplied weight column name and column name pairs.static AggregationCreate aweighted sumaggregation for the supplied weight column name and column name pairs.static Aggregationof(Aggregation... aggregations) Pass through a singleAggregation, or combine many into anAggregations.static ColumnAggregationstatic AggregationCombine anAggSpecand one or more input/outputcolumn name pairsinto aColumnAggregationorColumnAggregations.static AggregationCombine anAggSpecand one or more input/outputcolumn name pairsinto aColumnAggregationorColumnAggregations.static <INPUT_TYPE>
Aggregationof(BiFunction<ColumnName, INPUT_TYPE, ColumnAggregation> columnAggFactory, String inputColumn, INPUT_TYPE... inputs) Create a single or compoundAggregationfrom a single input column and one or more per-aggregation input values.static PercentileOutputstatic voidvisitAll(Aggregation.Visitor visitor) Calls every single visit method ofvisitorwith anullobject.<V extends Aggregation.Visitor>
Vwalk(V visitor) Glue method to deliver this Aggregation to aAggSpec.Visitor.
-
Method Details
-
of
- Parameters:
spec- Theaggregation specifierto apply to the column name pairpair- Theinput/output column name pair- Returns:
- The aggregation
-
of
Combine anAggSpecand one or more input/outputcolumn name pairsinto aColumnAggregationorColumnAggregations.- Parameters:
spec- Theaggregation specifierto apply to the column name pair(s)pairs- The input/output column namepairorpairs- Returns:
- The aggregation
-
of
Combine anAggSpecand one or more input/outputcolumn name pairsinto aColumnAggregationorColumnAggregations.- Parameters:
spec- Theaggregation specifierto apply to the column name pair(s)pairs- The input/output column namepairorpairs- Returns:
- The aggregation
-
of
Pass through a singleAggregation, or combine many into anAggregations.- Parameters:
aggregations- Theaggregationsto combine- Returns:
- The combined aggregation
-
of
@SafeVarargs static <INPUT_TYPE> Aggregation of(BiFunction<ColumnName, INPUT_TYPE, ColumnAggregation> columnAggFactory, String inputColumn, INPUT_TYPE... inputs) Create a single or compoundAggregationfrom a single input column and one or more per-aggregation input values.- Parameters:
columnAggFactory- A factory for combining an input column and input value into aaggregationinputColumn- The input column for each component of the resulting aggregationinputs- The input values to combine with the input column via the factory- Returns:
- The combined aggregation
-
AggAbsSum
Create anabsolute sumaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggApproxPct
Create anapproximate percentileaggregation for the supplied percentile and column name pairs with the default T-Digestcompressionfactor.- Parameters:
percentile- Thepercentileto use for all component aggregationspairs- The input/output column name pairs- Returns:
- The aggregation
-
AggApproxPct
Create anapproximate percentileaggregation for the supplied percentile, T-Digest compression factor, and column name pairs.- Parameters:
percentile- Thepercentileto use for all component aggregationscompression- T-Digestcompressionfactor; must be > 1, should probably be < 1000pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggApproxPct
Create anapproximate percentileaggregation for the supplied input column name and percentile/output column name pairs with the default T-Digestcompressionfactor.- Parameters:
inputColumn- The input column namepercentileOutputs- Thepercentile/output column name pairsfor the component aggregations; seePctOut(double, String).- Returns:
- The aggregation
-
AggApproxPct
static Aggregation AggApproxPct(String inputColumn, double compression, PercentileOutput... percentileOutputs) Create anapproximate percentileaggregation for the supplied input column name, T-Digest compression factor, and percentile/output column name pairs.- Parameters:
inputColumn- The input column namecompression- T-Digestcompressionfactor; must be > 1, should probably be < 1000percentileOutputs- Thepercentile/output column name pairsfor the component aggregations; seePctOut(double, String).- Returns:
- The aggregation
-
AggAvg
Create anaverage(arithmetic mean) aggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggCount
Create acountaggregation with the supplied output column name.- Parameters:
resultColumn- Theoutput columnname- Returns:
- The aggregation
-
AggCountWhere
Create acountaggregation with the supplied output column name, counting values that pass the suppliedfilters.- Parameters:
resultColumn- Theoutput columnnamefilters- The filters to apply to the input columns- Returns:
- The aggregation
-
AggCountWhere
Create acountaggregation with the supplied output column name, counting values that pass the suppliedfilter.- Parameters:
resultColumn- Theoutput columnnamefilter- TheFilterto apply to the input columns- Returns:
- The aggregation
-
AggCountDistinct
Create acount distinctaggregation for the supplied column name pairs. This will not countnullvalues from the input column(s).- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggCountDistinct
Create acount distinctaggregation for the supplied column name pairs. This will countnullvalues from the input column(s) ifcountNullsistrue.- Parameters:
countNulls- Whethernullvalues should be counted; seeAggSpecCountDistinct.countNulls()}pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggDistinct
Create adistinctaggregation for the supplied column name pairs. This will not includenullvalues in the output column(s).- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggDistinct
Create adistinctaggregation for the supplied column name pairs. This will includenullvalues in the output column(s) ifincludeNullsistrue.- Parameters:
includeNulls- Whethernullvalues should be included; seeAggSpecDistinct.includeNulls()pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggFirst
Create afirstaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggFirstRowKey
Create afirst row keyaggregation with the supplied result column.- Parameters:
resultColumn- Theoutput columnname- Returns:
- The aggregation
-
AggFormula
Create a
formulaaggregation with the suppliedformula. This variant requires the formula to provide the output column name and specific input column names in the following format:AggFormula("output_col=(input_col1 + input_col2) * input_col3")- Parameters:
formulaString- The formula to use to produce the output column- Returns:
- The aggregation
-
AggFormula
Create a
formulaaggregation with the suppliedcolumnNameandexpression. This variant requires the formula to provide the output column name and the expression to evaluate in the following format:AggFormula("output_col", "(input_col1 + input_col2) * input_col3")- Parameters:
columnName- The output column nameexpression- The expression to use to produce the output column- Returns:
- The aggregation
-
AggFormula
Deprecated.- Parameters:
formula- Theformulato use for all input columns to produce all output columnsparamToken- Theparameter tokento replace with the input column name informulapairs- The input/output column name pairs- Returns:
- The aggregation
-
AggFreeze
Create afreezeaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggGroup
Create agroupaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggLast
Create alastaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggLastRowKey
Create alast row keyaggregation with the supplied result column.- Parameters:
resultColumn- Theoutput columnname- Returns:
- The aggregation
-
AggMax
Create amaxaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggMed
Create amedianaggregation for the supplied column name pairs. For numeric types, if there are an even number of values the result will be an average of the two middle values.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggMed
Create amedianaggregation for the supplied column name pairs. For numeric types, if there are an even number of values the result will be an average of the two middle values ifaverageistrue, else the result will be the lower of the two middle values.- Parameters:
average- Whether to average the middle two values for even-sized result sets of numeric types; seeAggSpecMedian.averageEvenlyDivided()pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggMin
Create aminaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggPartition
Create apartitionaggregation with the supplied output column name and group-by columns included in the output sub-tables.- Parameters:
resultColumn- Theoutput columnname- Returns:
- The aggregation
-
AggPartition
Create apartitionaggregation with the supplied output column name.- Parameters:
resultColumn- Theoutput columnnameincludeGroupByColumns- Whether to include group-by columns in the result- Returns:
- The aggregation
-
AggPct
Create apercentileaggregation for the supplied percentile and column name pairs.- Parameters:
percentile- Thepercentileto use for all component aggregationspairs- The input/output column name pairs- Returns:
- The aggregation
-
AggPct
Create apercentileaggregation for the supplied percentile and column name pairs. If the percentile equally divides the value space, the result will be the average of the values immediately below and above ifaverageistrue.- Parameters:
percentile- Thepercentileto use for all component aggregationsaverage- Whether to average the lower and higher values for evenly divided result sets of numeric types; seeAggSpecPercentile.averageEvenlyDivided()pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggPct
Create apercentileaggregation for the supplied input column name and percentile/output column name pairs.- Parameters:
inputColumn- The input column namepercentileOutputs- Thepercentile/output column name pairsfor the component aggregations; seePctOut(double, String).- Returns:
- The aggregation
-
AggPct
static Aggregation AggPct(String inputColumn, boolean average, PercentileOutput... percentileOutputs) Create apercentileaggregation for the supplied input column name and percentile/output column name pairs. If the percentile equally divides the value space, the result will be the average of the values immediately below and above ifaverageistrue.- Parameters:
inputColumn- The input column nameaverage- Whether to average the lower and higher values for evenly divided result sets of numeric types; seeAggSpecPercentile.averageEvenlyDivided()percentileOutputs- Thepercentile/output column name pairsfor the component aggregations; seePctOut(double, String).- Returns:
- The aggregation
-
AggSortedFirst
Create asorted firstaggregation for the supplied sort column name and input/output column name pairs.- Parameters:
sortColumn- The sort column namepairs- The input/output column name pairs for the component aggregations- Returns:
- The aggregation
-
AggSortedFirst
Create asorted firstaggregation for the supplied sort column names and input/output column name pairs.- Parameters:
sortColumns- The sort column namespairs- The input/output column name pairs for the component aggregations- Returns:
- The aggregation
-
AggSortedLast
Create asorted lastaggregation for the supplied sort column name and input/output column name pairs.- Parameters:
sortColumn- The sort column namepairs- The input/output column name pairs for the component aggregations- Returns:
- The aggregation
-
AggSortedLast
Create asorted lastaggregation for the supplied sort column names and input/output column name pairs.- Parameters:
sortColumns- The sort column namespairs- The input/output column name pairs for the component aggregations- Returns:
- The aggregation
-
AggStd
Create asample standard deviationaggregation for the supplied column name pairs.Sample standard deviation is computed using Bessel's correction (https://en.wikipedia.org/wiki/Bessel%27s_correction), which ensures that the sample variance will be an unbiased estimator of population variance.
- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggSum
Create asumaggregation for the supplied column name pairs.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggTDigest
Create aT-Digestaggregation for the supplied column name pairs with the default T-Digestcompressionfactor.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggTDigest
Create aT-Digestaggregation for the supplied column name pairs with the suppliedcompressionfactor.- Parameters:
compression- T-Digestcompressionfactor; must be > 1, should probably be < 1000pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggUnique
Create auniqueaggregation for the supplied column name pairs. This will not considernullvalues when determining if a group has a single unique value. Non-unique groups will havenullvalues in the output column.- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggUnique
Create auniqueaggregation for the supplied column name pairs. This will considernullvalues when determining if a group has a single unique value ifincludeNullsistrue. Non-unique groups will havenullvalues in the output column.- Parameters:
includeNulls- Whether to considernullvalues towards uniqueness; seeAggSpecUnique.includeNulls()pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggUnique
Create auniqueaggregation for the supplied column name pairs. This will considernullvalues when determining if a group has a single unique value ifincludeNullsistrue. Non-unique groups will have the value wrapped bynonUniqueSentinelin the output column.- Parameters:
includeNulls- Whether to considernullvalues towards uniquenessnonUniqueSentinel- The value to output for non-unique groupspairs- The input/output column name pairs- Returns:
- The aggregation
-
AggVar
Create asample varianceaggregation for the supplied column name pairs.Sample variance is computed using Bessel's correction (https://en.wikipedia.org/wiki/Bessel%27s_correction), which ensures that the sample variance will be an unbiased estimator of population variance.
- Parameters:
pairs- The input/output column name pairs- Returns:
- The aggregation
-
AggWAvg
Create aweighted averageaggregation for the supplied weight column name and column name pairs.- Parameters:
weightColumn- Theweight column namepairs- The input/output column name pairs- Returns:
- The aggregation
-
AggWSum
Create aweighted sumaggregation for the supplied weight column name and column name pairs.- Parameters:
weightColumn- Theweight column namepairs- The input/output column name pairs- Returns:
- The aggregation
-
PctOut
Make apercentile/output column name pair. This allows for strongly-typed input to various approximate percentile and percentile aggregation factory methods.- Parameters:
percentile- The percentile for the aggregationoutputColumn- The output column name to associate with the percentile- Returns:
- The percentile/output column name pair
- See Also:
-
visitAll
Calls every single visit method ofvisitorwith anullobject.- Parameters:
visitor- the visitor
-
walk
Glue method to deliver this Aggregation to aAggSpec.Visitor.- Parameters:
visitor- The visitor- Returns:
- The visitor
-