fm.create.agg.op | R Documentation |
This function creates an aggregate operator for aggregation operations on a FlashR object.
fm.create.agg.op(agg, combine, name)
agg |
a |
combine |
a |
name |
a string indicating the name of the aggregation operator. |
An Aggregate operator has two parts. agg
computes partial
aggregation results and combine
combines the partial aggregation
results to compute the final result. Both agg
and combine
are the type of fm.basic.op
.
The main reason of using two operators is for parallelization. Each thread computes aggregation on part of the object. Eventually, we need an operator to combine all partial aggregation results.
For many aggregation operations, agg
and combine
are the same.
For example, in the case of summation, both agg
and combine
are simply +
. In some cases, these two operators can be different.
For example, when counting the occurences of unique values, agg
is count
and combine
is +
.
a fm.agg.op
operator.
agg.op <- fm.create.agg.op(fm.bo.add, fm.bo.add, "sum")