Class ProjectingPagesWindowIndex

  • All Implemented Interfaces:
    WindowIndex

    public class ProjectingPagesWindowIndex
    extends Object
    implements WindowIndex
    This class represents a WindowIndex with additional "channels" which are not part of the underlying PagesIndex.

    The purpose of this class is to provide input for aggregations in a consistent way, regardless of whether the aggregation uses an input channel, or a runtime-evaluated expression as the argument.

    The latter case applies to aggregate functions within the DEFINE and MEASURES clauses of row pattern recognition. The aggregated argument can be based on CLASSIFIER() or MATCH_NUMBER() results which are not present in the input, and thus needs to be evaluated at runtime while processing a row.

    E.g. for the aggregate function array_agg(lower(CLASSIFIER(X))), there is no input channel containing the aggregated argument, so it is evaluated row by row at runtime and passed in an additional "channel" available to the aggregation's accumulator by a standard WindowIndex interface.

    • Method Detail

      • setLabelAndMatchNumber

        public void setLabelAndMatchNumber​(int currentPosition,
                                           int label,
                                           long matchNumber)
      • isNull

        public boolean isNull​(int channel,
                              int position)
        Specified by:
        isNull in interface WindowIndex
      • getBoolean

        public boolean getBoolean​(int channel,
                                  int position)
        Specified by:
        getBoolean in interface WindowIndex
      • getLong

        public long getLong​(int channel,
                            int position)
        Specified by:
        getLong in interface WindowIndex
      • getDouble

        public double getDouble​(int channel,
                                int position)
        Specified by:
        getDouble in interface WindowIndex
      • getSlice

        public io.airlift.slice.Slice getSlice​(int channel,
                                               int position)
        Specified by:
        getSlice in interface WindowIndex