Class RankingWindowFunction

java.lang.Object
io.trino.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
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    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.
    final 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 state for a new partition (including the first one).
    final void
    reset(WindowIndex windowIndex)
    Reset state for a new partition (including the first one).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • RankingWindowFunction

      public RankingWindowFunction()
  • Method Details

    • 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 interface WindowFunction
      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 interface WindowFunction
      Parameters:
      output - the BlockBuilder to use for writing the output row
      peerGroupStart - the position of the first row in the peer group
      peerGroupEnd - the position of the last row in the peer group
      frameStart - the position of the first row in the window frame
      frameEnd - 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 - the BlockBuilder to use for writing the output row
      newPeerGroup - if this row starts a new peer group
      peerGroupCount - the total number of rows in this peer group
      currentPosition - the current position for this row