fm.create.agg.opR Documentation

Create an aggregate operator

Description

This function creates an aggregate operator for aggregation operations on a FlashR object.

Usage

fm.create.agg.op(agg, combine, name)

Arguments

agg

a fm.basic.op operator that computes partial aggregation results.

combine

a fm.basic.op operator that computes the final result.

name

a string indicating the name of the aggregation operator.

Details

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 +.

Value

a fm.agg.op operator.

Examples

agg.op <- fm.create.agg.op(fm.bo.add, fm.bo.add, "sum")