Package mondrian.olap
Interface Aggregator
-
- All Known Implementing Classes:
RolapAggregator
,RolapAggregator.AvgFromAvg
,RolapAggregator.AvgFromSum
,RolapAggregator.BaseAggor
,RolapAggregator.SumFromAvg
public interface Aggregator
Describes an aggregation operator, such as "sum" or "count".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
aggregate(List<Object> rawData, Dialect.Datatype datatype)
Applies this aggregator over a raw list of objects for a rollup operation.Object
aggregate(Evaluator evaluator, TupleList members, Calc calc)
Applies this aggregator to an expression over a set of members and returns the result.Aggregator
getRollup()
Returns the aggregator used to combine sub-totals into a grand-total.boolean
supportsFastAggregates(Dialect.Datatype datatype)
Tells Mondrian if this aggregator can perform fast aggregation using only the raw data of a given object type.
-
-
-
Method Detail
-
getRollup
Aggregator getRollup()
Returns the aggregator used to combine sub-totals into a grand-total.- Returns:
- aggregator used to combine sub-totals into a grand-total
-
aggregate
Object aggregate(Evaluator evaluator, TupleList members, Calc calc)
Applies this aggregator to an expression over a set of members and returns the result.- Parameters:
evaluator
- Evaluation contextmembers
- List of members, not nullcalc
- Expression to evaluate- Returns:
- result of applying this aggregator to a set of members/tuples
-
supportsFastAggregates
boolean supportsFastAggregates(Dialect.Datatype datatype)
Tells Mondrian if this aggregator can perform fast aggregation using only the raw data of a given object type. This will determine if Mondrian will attempt to perform in-memory rollups on raw segment data by invokingaggregate(mondrian.olap.Evaluator, mondrian.calc.TupleList, mondrian.calc.Calc)
.This is only invoked for rollup operations.
- Parameters:
datatype
- The datatype of the object we would like to rollup.- Returns:
- Whether this aggregator supports fast aggregation
-
aggregate
Object aggregate(List<Object> rawData, Dialect.Datatype datatype)
Applies this aggregator over a raw list of objects for a rollup operation. This is useful when the values are already resolved and we are dealing with a rawSegmentBody
object.Only gets called if
supportsFastAggregates(mondrian.spi.Dialect.Datatype)
is true.This is only invoked for rollup operations.
- Parameters:
rawData
- An array of values in its raw form, to be aggregated.- Returns:
- A rolled up value of the raw data. if the object type is not supported.
-
-