Class IndexAggregateFunctionCall


  • @API(INTERNAL)
    public class IndexAggregateFunctionCall
    extends Object
    Class to represent a construct AGG by Set.of(col1, col2, ...). This is the unbound equivalent of an IndexAggregateFunction which itself is bound to an index and represents its group-by columns as a list of KeyExpression that match the order imposed by bound index rather than a set. There are two use cases for this class:
    1. regular aggregation functions that need the enumeration of permutation of the grouping expressions in order to bind the call to a IndexAggregateFunction. The logic implementing this use case calls enumerateIndexAggregateFunctionCandidates(String) at some point.
    2. aggregation-oriented operators that function more like closures over a group (see ComposedBitmapIndexAggregate for such an example) in which cases it may be needed to propagate the original GroupingKeyExpression to the binding phase thus eliminating the possibility of an enumeration of permutations of grouping columns altogether. In those cases it may be simply impossible to compute an equivalent list of such grouping columns from the original grouping key expression without losing some of the nesting/repeating information.
    Note that if a client of this class intends to use an aggregate function call for regular aggregation functions and intends to call methods such as enumerateIndexAggregateFunctionCandidates(String), the following must hold in order to yield meaningful results:
     groupingKeyExpression = concat(groupingExpressions, groupedExpression).group(groupedExpression.getColumnSize())
     
    which ideally is true, but may be violated in the presence of repeated structures.