Class RolapAggregator

    • Constructor Detail

      • RolapAggregator

        public RolapAggregator​(java.lang.String name,
                               int ordinal,
                               boolean distinct)
    • Method Detail

      • isDistinct

        public boolean isDistinct()
      • getExpression

        public java.lang.String getExpression​(java.lang.String operand)
        Returns the expression to apply this aggregator to an operand. For example, getExpression("emp.sal") returns "sum(emp.sal)".
      • getNonDistinctAggregator

        public RolapAggregator getNonDistinctAggregator()
        If this is a distinct aggregator, returns the corresponding non-distinct aggregator, otherwise throws an error.
      • getRollup

        public Aggregator getRollup()
        Returns the aggregator used to roll up. By default, aggregators roll up themselves.
        Specified by:
        getRollup in interface Aggregator
        Returns:
        aggregator used to combine sub-totals into a grand-total
      • supportsFastAggregates

        public boolean supportsFastAggregates​(Dialect.Datatype dataType)
        By default, fast rollup is not supported for all classes.
        Specified by:
        supportsFastAggregates in interface Aggregator
        Parameters:
        dataType - The datatype of the object we would like to rollup.
        Returns:
        Whether this aggregator supports fast aggregation
      • aggregate

        public java.lang.Object aggregate​(java.util.List<java.lang.Object> rawData,
                                          Dialect.Datatype datatype)
        Description copied from interface: Aggregator
        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 Aggregator.supportsFastAggregates(mondrian.spi.Dialect.Datatype) is true.

        This is only invoked for rollup operations.

        Specified by:
        aggregate in interface Aggregator
        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.