Package dev.frostlake.executor
Class KeyCollations
java.lang.Object
dev.frostlake.executor.KeyCollations
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 Summary
Modifier and TypeMethodDescriptionstatic booleanWhether any key here could carry a collation at all: some relation in scope declares one on a column, or some key writes COLLATE itself.static CollationSpec[]resolve(List<String> keys, ExpressionEvaluator evaluator) The collation each key compares under.
-
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 writtentable- the query's base relation, or nullaliasToTable- its alias map, or nullallTables- its joined relations, or null- Returns:
- false when no key can be collated, and the caller can compare by code point
-
resolve
The collation each key compares under.- Parameters:
keys- the key expressions as writtenevaluator- the evaluator that resolves their columns- Returns:
- one entry per key, null where the key carries no collation
-