Class AbstractAggregateFunDef

java.lang.Object
org.eigenbase.xom.XMLUtil
org.eigenbase.xom.XOMUtil
All Implemented Interfaces:
FunDef
Direct Known Subclasses:
AggregateFunDef, NthQuartileFunDef

public class AbstractAggregateFunDef extends FunDefBase
Abstract base class for all aggregate functions (Aggregate, Sum, Avg, et cetera).
Since:
2005/8/14
Author:
jhyde
  • Constructor Details

    • AbstractAggregateFunDef

      public AbstractAggregateFunDef(FunDef dummyFunDef)
  • Method Details

    • validateArg

      protected Exp validateArg(Validator validator, Exp[] args, int i, int category)
      Description copied from class: FunDefBase
      Validates an argument to a call to this function.

      The default implementation of this method adds an implicit conversion to the correct type. Derived classes may override.

      Overrides:
      validateArg in class FunDefBase
      Parameters:
      validator - Validator
      args - Arguments to this function
      i - Ordinal of argument
      category - Expected category of argument
      Returns:
      Validated argument
    • evaluateCurrentList

      protected static TupleList evaluateCurrentList(ListCalc listCalc, Evaluator evaluator)
      Evaluates the list of members or tuples used in computing the aggregate. If the measure for aggregation has to ignore unrelated dimensions this method will push unrelated dimension members to top level member. This behaviour is driven by the ignoreUnrelatedDimensions property on a base cube usage specified in the virtual cube.Keeps track of the number of iterations that will be required to iterate over the members or tuples needed to compute the aggregate within the current context. In doing so, also determines if the cross product of all iterations across all parent evaluation contexts will exceed the limit set in the properties file.
      Parameters:
      listCalc - calculator used to evaluate the member list
      evaluator - current evaluation context
      Returns:
      list of evaluated members or tuples
    • evaluateCurrentIterable

      protected TupleIterable evaluateCurrentIterable(IterCalc iterCalc, Evaluator evaluator)
    • processUnrelatedDimensions

      public static TupleList processUnrelatedDimensions(TupleList tuplesForAggregation, Evaluator evaluator)
      Pushes unrelated dimensions to the top level member from the given list of tuples if the ignoreUnrelatedDimensions property is set on the base cube usage in the virtual cube.

      If IgnoreMeasureForNonJoiningDimension is set to true and ignoreUnrelatedDimensions on CubeUsage is set to false then if a non joining dimension exists in the aggregation list then return an empty list else return the original list.

      Parameters:
      tuplesForAggregation - is a list of members or tuples used in computing the aggregate
      evaluator - Evaluator
      Returns:
      list of members or tuples