public class IntegerAggregator extends java.lang.Object implements Aggregator
Modifier and Type | Class and Description |
---|---|
private class |
IntegerAggregator.MyInteger |
Aggregator.Op, Aggregator.TupleMapIterator
Modifier and Type | Field and Description |
---|---|
private int |
aField |
private java.util.HashMap<Field,IntegerAggregator.MyInteger> |
fieldResMap |
private java.util.HashMap<Field,Tuple> |
fieldTupleMap |
private int |
gbField |
private Type |
gbFieldType |
private Tuple |
noGroupTuple |
private Aggregator.Op |
op |
private static long |
serialVersionUID |
private TupleDesc |
tupleDesc |
NO_GROUPING, noGroupField
Constructor and Description |
---|
IntegerAggregator(int gbfield,
Type gbfieldtype,
int afield,
Aggregator.Op what)
Aggregate constructor
|
Modifier and Type | Method and Description |
---|---|
DbIterator |
iterator()
Create a DbIterator over group aggregate results.
|
void |
mergeTupleIntoGroup(Tuple tup)
Merge a new tuple into the aggregate, grouping as indicated in the
constructor
|
private static final long serialVersionUID
private int gbField
private int aField
private Type gbFieldType
private Aggregator.Op op
private java.util.HashMap<Field,IntegerAggregator.MyInteger> fieldResMap
private TupleDesc tupleDesc
private Tuple noGroupTuple
public IntegerAggregator(int gbfield, Type gbfieldtype, int afield, Aggregator.Op what)
gbfield
- the 0-based index of the group-by field in the tuple, or
NO_GROUPING if there is no groupinggbfieldtype
- the type of the group by field (e.g., Type.INT_TYPE), or null
if there is no groupingafield
- the 0-based index of the aggregate field in the tuplewhat
- the aggregation operatorpublic void mergeTupleIntoGroup(Tuple tup)
mergeTupleIntoGroup
in interface Aggregator
tup
- the Tuple containing an aggregate field and a group-by fieldpublic DbIterator iterator()
iterator
in interface Aggregator
for a possible helper