Class ProjectingPagesWindowIndex
- java.lang.Object
-
- io.trino.operator.window.pattern.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.
-
-
Constructor Summary
Constructors Constructor Description ProjectingPagesWindowIndex(PagesIndex pagesIndex, int start, int end, List<ArgumentComputation> projections, List<String> labelNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendTo(int channel, int position, BlockBuilder output)booleangetBoolean(int channel, int position)doublegetDouble(int channel, int position)longgetLong(int channel, int position)ObjectgetObject(int channel, int position)BlockgetSingleValueBlock(int channel, int position)io.airlift.slice.SlicegetSlice(int channel, int position)booleanisNull(int channel, int position)voidsetLabelAndMatchNumber(int currentPosition, int label, long matchNumber)intsize()StringtoString()
-
-
-
Constructor Detail
-
ProjectingPagesWindowIndex
public ProjectingPagesWindowIndex(PagesIndex pagesIndex, int start, int end, List<ArgumentComputation> projections, List<String> labelNames)
-
-
Method Detail
-
setLabelAndMatchNumber
public void setLabelAndMatchNumber(int currentPosition, int label, long matchNumber)
-
size
public int size()
- Specified by:
sizein interfaceWindowIndex
-
isNull
public boolean isNull(int channel, int position)- Specified by:
isNullin interfaceWindowIndex
-
getBoolean
public boolean getBoolean(int channel, int position)- Specified by:
getBooleanin interfaceWindowIndex
-
getLong
public long getLong(int channel, int position)- Specified by:
getLongin interfaceWindowIndex
-
getDouble
public double getDouble(int channel, int position)- Specified by:
getDoublein interfaceWindowIndex
-
getSlice
public io.airlift.slice.Slice getSlice(int channel, int position)- Specified by:
getSlicein interfaceWindowIndex
-
getSingleValueBlock
public Block getSingleValueBlock(int channel, int position)
- Specified by:
getSingleValueBlockin interfaceWindowIndex
-
getObject
public Object getObject(int channel, int position)
- Specified by:
getObjectin interfaceWindowIndex
-
appendTo
public void appendTo(int channel, int position, BlockBuilder output)- Specified by:
appendToin interfaceWindowIndex
-
-