Description
Lists every hypothetical (what-if) projection defined in the current session. See CREATE HYPOTHETICAL PROJECTION and EXPLAIN WHATIF.
The contents are session-scoped: each connection sees only its own hypothetical projections, and the table is empty when none have been created in the current session.
The current (database, table) are resolved by UUID at query time, so they reflect RENAME TABLE and entries for dropped tables are hidden automatically.
Columns
database(String) — Database nametable(String) — Table namename(String) — Projection nametype(Enum8(‘Normal’ = 0, ‘Aggregate’ = 1)) — Projection typesorting_key(Array(String)) — Projection sorting keyquery(String) — Projection SELECT query, empty for the INDEX … TYPE … formdefinition(String) — Full projection declaration as writtensettings(Map(String, String)) — Projection settings from WITH SETTINGS
Examples
CREATE HYPOTHETICAL PROJECTION p_by_b ON t (SELECT a, b ORDER BY b);
SELECT name, type, sorting_key FROM system.hypothetical_projections;┌─name───┬─type───┬─sorting_key─┐
│ p_by_b │ Normal │ ['b'] │
└────────┴────────┴─────────────┘