Package io.prestosql.spi.function
Class RankingWindowFunction
- java.lang.Object
-
- io.prestosql.spi.function.RankingWindowFunction
-
- All Implemented Interfaces:
WindowFunction
public abstract class RankingWindowFunction extends Object implements WindowFunction
-
-
Field Summary
Fields Modifier and Type Field Description protected WindowIndex
windowIndex
-
Constructor Summary
Constructors Constructor Description RankingWindowFunction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
processRow(BlockBuilder output, boolean newPeerGroup, int peerGroupCount, int currentPosition)
Process a row by outputting the result of the window function.void
processRow(BlockBuilder output, int peerGroupStart, int peerGroupEnd, int frameStart, int frameEnd)
Process a row by outputting the result of the window function.void
reset()
Reset state for a new partition (including the first one).void
reset(WindowIndex windowIndex)
Reset state for a new partition (including the first one).
-
-
-
Field Detail
-
windowIndex
protected WindowIndex windowIndex
-
-
Method Detail
-
reset
public final void reset(WindowIndex windowIndex)
Description copied from interface:WindowFunction
Reset state for a new partition (including the first one).- Specified by:
reset
in 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:WindowFunction
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).- Specified by:
processRow
in interfaceWindowFunction
- Parameters:
output
- theBlockBuilder
to 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
- theBlockBuilder
to 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
-
-