Class Aggregation


  • public class Aggregation
    extends Object
    A Aggregation is a pre-computed aggregation over a set of columns.

    Rollup operations:

    • drop an unrestricted column (e.g. state=*)
    • tighten any restriction (e.g. year={1997,1998} becomes year={1997})
    • restrict an unrestricted column (e.g. year=* becomes year={1997})

    Representation of aggregations. Sparse and dense representations are necessary for different data sets. Should adapt automatically. Use an interface to hold the data set, so the segment doesn't care.

    Suppose we have a segment {year=1997, quarter={1,2,3}, state={CA,WA}}. We want to roll up to a segment for {year=1997, state={CA,WA}}. We need to know that we have all quarters. We don't. Because year and quarter are independent, we know that we have all of the ...

    Suppose we have a segment specified by {region=West, state=*, year=*}, which materializes to ({West}, {CA,WA,OR}, {1997,1998}). Because state=*, we can rollup to {region=West, year=*} or {region=West, year=1997}.

    The space required for a segment depends upon the dimensionality (d), cell count (c) and the value count (v). We don't count the space required for the actual values, which is the same in any scheme.

    Since:
    28 August, 2001
    Author:
    jhyde
    • Constructor Detail

      • Aggregation

        public Aggregation​(AggregationKey aggregationKey)
        Creates an Aggregation.
        Parameters:
        aggregationKey - the key specifying the axes, the context and the RolapStar for this Aggregation
    • Method Detail

      • getCreationTimestamp

        public Date getCreationTimestamp()
        Returns:
        Returns the timestamp when the aggregation was created
      • load

        public void load​(SegmentCacheManager cacheMgr,
                         int cellRequestCount,
                         RolapStar.Column[] columns,
                         List<RolapStar.Measure> measures,
                         StarColumnPredicate[] predicates,
                         GroupingSetsCollector groupingSetsCollector,
                         List<Future<Map<Segment,​SegmentWithData>>> segmentFutures)
        Loads a set of segments into this aggregation, one per measure, each constrained by the same set of column values, and each pinned once.

        A Column and its constraints are accessed at the same level in their respective arrays.

        For example,

         measures = {unit_sales, store_sales},
         state = {CA, OR},
         gender = unconstrained
        Parameters:
        segmentFutures - List of futures wherein each statement will place a list of the segments it has loaded, when it completes
      • getStar

        public RolapStar getStar()
        This is called during SQL generation.
      • getConstrainedColumnsBitKey

        public BitKey getConstrainedColumnsBitKey()
        Returns the BitKey for ALL columns (Measures and Levels) involved in the query.