public class UnsortedGrouping<T> extends Grouping<T>
| Constructor and Description |
|---|
UnsortedGrouping(DataSet<T> set,
Keys<T> keys) |
| Modifier and Type | Method and Description |
|---|---|
AggregateOperator<T> |
aggregate(Aggregations agg,
int field)
Applies an Aggregate transformation on a grouped
Tuple DataSet.Note: Only Tuple DataSets can be aggregated. The transformation applies a built-in Aggregation on a specified field
of a Tuple group. |
AggregateOperator<T> |
max(int field)
Syntactic sugar for aggregate (MAX, field)
|
AggregateOperator<T> |
min(int field)
Syntactic sugar for aggregate (MIN, field)
|
ReduceOperator<T> |
reduce(ReduceFunction<T> reducer)
Applies a Reduce transformation on a grouped
DataSet.For each group, the transformation consecutively calls a RichReduceFunction
until only a single element for each group remains. |
<R> GroupReduceOperator<T,R> |
reduceGroup(GroupReduceFunction<T,R> reducer)
Applies a GroupReduce transformation on a grouped
DataSet.The transformation calls a RichGroupReduceFunction for each group of the DataSet. |
SortedGrouping<T> |
sortGroup(int field,
Order order)
Sorts
Tuple elements within a group on the specified field in the specified Order.
Note: Only groups of Tuple elements can be sorted.Groups can be sorted by multiple fields by chaining sortGroup(int, Order) calls. |
AggregateOperator<T> |
sum(int field)
Syntactic sugar for aggregate (SUM, field)
|
getDataSet, getKeyspublic AggregateOperator<T> aggregate(Aggregations agg, int field)
Tuple DataSet.Aggregation on a specified field
of a Tuple group. Additional aggregation functions can be added to the resulting
AggregateOperator by calling AggregateOperator.and(Aggregations, int).agg - The built-in aggregation function that is computed.field - The index of the Tuple field on which the aggregation function is applied.Tuple,
Aggregations,
AggregateOperator,
DataSetpublic AggregateOperator<T> sum(int field)
field - The index of the Tuple field on which the aggregation function is applied.AggregateOperatorpublic AggregateOperator<T> max(int field)
field - The index of the Tuple field on which the aggregation function is applied.AggregateOperatorpublic AggregateOperator<T> min(int field)
field - The index of the Tuple field on which the aggregation function is applied.AggregateOperatorpublic ReduceOperator<T> reduce(ReduceFunction<T> reducer)
DataSet.RichReduceFunction
until only a single element for each group remains.
A ReduceFunction combines two elements into one new element of the same type.reducer - The ReduceFunction that is applied on each group of the DataSet.RichReduceFunction,
ReduceOperator,
DataSetpublic <R> GroupReduceOperator<T,R> reduceGroup(GroupReduceFunction<T,R> reducer)
DataSet.RichGroupReduceFunction for each group of the DataSet.
A GroupReduceFunction can iterate over all elements of a group and emit any
number of output elements including none.reducer - The GroupReduceFunction that is applied on each group of the DataSet.RichGroupReduceFunction,
GroupReduceOperator,
DataSetpublic SortedGrouping<T> sortGroup(int field, Order order)
Tuple elements within a group on the specified field in the specified Order.
Note: Only groups of Tuple elements can be sorted.sortGroup(int, Order) calls.Copyright © 2014 The Apache Software Foundation. All rights reserved.