Package io.trino.spi.function
Class RankingWindowFunction
java.lang.Object
io.trino.spi.function.RankingWindowFunction
- All Implemented Interfaces:
WindowFunction
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidprocessRow(BlockBuilder output, boolean newPeerGroup, int peerGroupCount, int currentPosition) Process a row by outputting the result of the window function.final voidprocessRow(BlockBuilder output, int peerGroupStart, int peerGroupEnd, int frameStart, int frameEnd) Process a row by outputting the result of the window function.voidreset()Reset state for a new partition (including the first one).final voidreset(WindowIndex windowIndex) Reset state for a new partition (including the first one).
-
Field Details
-
windowIndex
-
-
Constructor Details
-
RankingWindowFunction
public RankingWindowFunction()
-
-
Method Details
-
reset
Description copied from interface:WindowFunctionReset state for a new partition (including the first one).- Specified by:
resetin interfaceWindowFunction- Parameters:
windowIndex- the window index which contains sorted values for the partition
-
processRow
public final void processRow(BlockBuilder output, int peerGroupStart, int peerGroupEnd, int frameStart, int frameEnd) Description copied from interface:WindowFunctionProcess a row by outputting the result of the window function. This method provides information about the ordering peer group. A peer group is all of the rows that are peers within the specified ordering. Rows are peers if they compare equal to each other using the specified ordering expression. The ordering of rows within a peer group is undefined (otherwise they would not be peers).- Specified by:
processRowin interfaceWindowFunction- Parameters:
output- theBlockBuilderto use for writing the output rowpeerGroupStart- the position of the first row in the peer grouppeerGroupEnd- the position of the last row in the peer groupframeStart- the position of the first row in the window frameframeEnd- the position of the last row in the window frame
-
reset
public void reset()Reset state for a new partition (including the first one). -
processRow
public abstract void processRow(BlockBuilder output, boolean newPeerGroup, int peerGroupCount, int currentPosition) Process a row by outputting the result of the window function. This method provides information about the ordering peer group. A peer group is all of the rows that are peers within the specified ordering. Rows are peers if they compare equal to each other using the specified ordering expression. The ordering of rows within a peer group is undefined (otherwise they would not be peers).- Parameters:
output- theBlockBuilderto use for writing the output rownewPeerGroup- if this row starts a new peer grouppeerGroupCount- the total number of rows in this peer groupcurrentPosition- the current position for this row
-