Class WindowPartitionOrder

java.lang.Object
dev.frostlake.executor.WindowPartitionOrder

public final class WindowPartitionOrder extends Object
First-occurrence 1-based position, RANK and DENSE_RANK of every row of ONE sorted window partition, built in a single pass over the partition. Keys are ROW VALUES with first-equal-wins puts, which reproduces the former per-output-row linear scans exactly: duplicate rows all read the FIRST duplicate's numbers.
  • Constructor Details

    • WindowPartitionOrder

      public WindowPartitionOrder(Map<Row,Long> positionByRow, Map<Row,Long> rankByRow, Map<Row,Long> denseRankByRow, int[] firstPeerByIndex, int[] lastPeerByIndex)
  • Method Details

    • position

      public Long position(Row row)
      1-based position of the first row equal to row, or null when no row equals it.
    • rank

      public Long rank(Row row)
    • denseRank

      public Long denseRank(Row row)
    • firstPeer

      public int firstPeer(int index)
    • lastPeer

      public int lastPeer(int index)