Enum Class RankingFunction

java.lang.Object
java.lang.Enum<RankingFunction>
com.darkcollective.relix.ast.RankingFunction
All Implemented Interfaces:
Serializable, Comparable<RankingFunction>, Constable

public enum RankingFunction extends Enum<RankingFunction>
The ranking window functions carried by a WindowFunction.RankingWindow.

All ranking functions produce a NUMBER per row and operate over the full sort order of the partition (a WindowFrame.PartitionFrame). The permit set is established in slice 2 so the exhaustive-switch enforcement guides slice 3; only WindowFunction.AggregateWindow is executable in slice 2.

  • Enum Constant Details

    • ROW_NUMBER

      public static final RankingFunction ROW_NUMBER
      Sequential 1-based position in the sort order (no ties).
    • RANK

      public static final RankingFunction RANK
      Rank with gaps after ties (e.g. 1, 1, 3).
    • DENSE_RANK

      public static final RankingFunction DENSE_RANK
      Rank without gaps after ties (e.g. 1, 1, 2).
    • PERCENT_RANK

      public static final RankingFunction PERCENT_RANK
      Relative rank (rank − 1) / (rows − 1) in [0.0, 1.0].
    • NTILE

      public static final RankingFunction NTILE
      Distributes rows into n buckets as evenly as possible.
  • Method Details

    • values

      public static RankingFunction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RankingFunction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null