use of com.tuplejump.stargate.lucene.Type in project stargate-core by tuplejump.
the class Group method addTuple.
public void addTuple(Tuple tuple) {
Tuple key = tuple.project(groupByFields, groupByExpressions);
Collection<Aggregate> groupValue = groups.get(key);
if (groupValue.isEmpty()) {
for (AggregateFactory aggregateFactory : aggregatesToCalculate) {
Type valueType = AggregateFunction.getLuceneType(options, aggregateFactory.getField());
Aggregate aggregate = aggregateFactory.getAggregate(valueType);
aggregate.aggregate(tuple);
groups.put(key, aggregate);
}
} else {
for (Aggregate aggregate : groupValue) {
aggregate.aggregate(tuple);
}
}
}
Aggregations