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".
Since:
Jul 9, 2003$
Author:
jhyde$
See Also:
  • Method Details

    • 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 context
      members - List of members, not null
      calc - 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 invoking aggregate(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 raw SegmentBody 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.