Class KeyCollations

java.lang.Object
dev.frostlake.executor.KeyCollations

public final class KeyCollations extends Object
The collation a sorting, grouping or de-duplicating key compares under. A collation reaches a key one of two ways — a column declared with one, or a COLLATE written into the key — so a query touching neither can skip resolving key collations altogether.
  • Method Details

    • reachable

      public static boolean reachable(List<String> keys, Table table, Map<String,Table> aliasToTable, List<Table> allTables)
      Whether any key here could carry a collation at all: some relation in scope declares one on a column, or some key writes COLLATE itself.
      Parameters:
      keys - the key expressions as written
      table - the query's base relation, or null
      aliasToTable - its alias map, or null
      allTables - its joined relations, or null
      Returns:
      false when no key can be collated, and the caller can compare by code point
    • resolve

      public static CollationSpec[] resolve(List<String> keys, ExpressionEvaluator evaluator)
      The collation each key compares under.
      Parameters:
      keys - the key expressions as written
      evaluator - the evaluator that resolves their columns
      Returns:
      one entry per key, null where the key carries no collation