Class ProjectingPagesWindowIndex

java.lang.Object
io.trino.operator.window.pattern.ProjectingPagesWindowIndex
All Implemented Interfaces:
InternalWindowIndex, WindowIndex

public class ProjectingPagesWindowIndex extends Object implements InternalWindowIndex
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.