Enum Class SortKeyRole

java.lang.Object
java.lang.Enum<SortKeyRole>
dev.frostlake.executor.expressions.SortKeyRole
All Implemented Interfaces:
Serializable, Comparable<SortKeyRole>, Constable

public enum SortKeyRole extends Enum<SortKeyRole>
The three GROUPING / SORTING key positions Snowflake names in its "cannot be used as ... keys" rejection. A FILE-typed expression is legal almost everywhere — it compares, de-duplicates and joins fine — but it may not be a key in any of these three positions, and the message names the position: live, GROUP BY f is "Expressions of type FILE cannot be used as GROUP BY keys" (SQLSTATE 42804), ORDER BY f the ORDER BY variant, and OVER (PARTITION BY f) the PARTITION BY variant.
  • Enum Constant Details

    • GROUP_BY

      public static final SortKeyRole GROUP_BY
      A GROUP BY key, including a positional ordinal, a SELECT alias and a ROLLUP/CUBE element.
    • ORDER_BY

      public static final SortKeyRole ORDER_BY
      An ORDER BY key, both the statement-level clause and the one inside an OVER spec.
    • PARTITION_BY

      public static final SortKeyRole PARTITION_BY
      A window PARTITION BY key.
  • Method Details

    • values

      public static SortKeyRole[] 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 SortKeyRole 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
    • getLabel

      public String getLabel()
      The clause name exactly as Snowflake spells it in the rejection message.