Class ShowModifierProfile
They do not do the same thing to all of them, and the differences are not guessable — this class is a transcription of what a real account answered on listing by listing, and the per-listing branches below each cite the reply that pins them.
Three facts drive the shape of this class:
- STARTS WITH and LIMIT are accepted far more widely than they are honoured. Snowflake
parses both on nearly every listing and then silently ignores them on seven or eight of them —
SHOW STAGES STARTS WITH 'ZZZ'returns both stages,SHOW SEQUENCES LIMIT 1returns both sequences,SHOW FUNCTIONS LIMIT 2returns all 1136 rows. Frostlake has to ignore them in exactly the same places, so the two booleans here are per-listing. - The honour sets for the two modifiers are not the same set. TAGS honours LIMIT
(
SHOW TAGS LIMIT 1→ 1 of 2) but ignores STARTS WITH (SHOW TAGS STARTS WITH 'ZZZ'→ both). Nothing about the object type predicts it. - TERSE is not one projection. It trims to five columns on TABLES/VIEWS/SCHEMAS/DATABASES/
OBJECTS, to those five plus a sixth on STREAMS (
tableOn) and TASKS (schedule), to an unrelated subset on ROLES and USERS, and to nothing at all — the full listing, unchanged — on the dozen others that still accept the keyword.
The TERSE column list is a target shape, not a filter: terseColumns() names the columns
the row must end up with, in order, and the projection fills each from the source listing when it has
a column of that name and with null when it does not. That keeps the column contract right even where
Frostlake's underlying listing models less than a real account's does.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShowModifierProfileThe profile for one parsed SHOW statement.booleanWhetherLIMIT n [FROM 'name']paginates this listing or is parsed and dropped.booleanWhetherSTARTS WITH 'prefix'filters this listing or is parsed and dropped.booleanWhether the listing is returned ordered by name — seesorted(boolean, boolean, java.util.List<java.lang.String>, java.lang.String, boolean).The columns TERSE projects onto, in order; empty when TERSE leaves the listing alone.The literalkindTERSE reports when the untrimmed listing has no such column.booleanWhetherkindis MATERIALIZED_VIEW / VIEW per row, read offis_materialized.
-
Method Details
-
sortsByName
public boolean sortsByName()Whether the listing is returned ordered by name — seesorted(boolean, boolean, java.util.List<java.lang.String>, java.lang.String, boolean). -
honorsStartsWith
public boolean honorsStartsWith()WhetherSTARTS WITH 'prefix'filters this listing or is parsed and dropped. -
honorsLimit
public boolean honorsLimit()WhetherLIMIT n [FROM 'name']paginates this listing or is parsed and dropped. -
terseColumns
The columns TERSE projects onto, in order; empty when TERSE leaves the listing alone. -
terseKind
The literalkindTERSE reports when the untrimmed listing has no such column. -
terseKindFromMaterializedFlag
public boolean terseKindFromMaterializedFlag()Whetherkindis MATERIALIZED_VIEW / VIEW per row, read offis_materialized. -
forStatement
The profile for one parsed SHOW statement.The order of the tests mirrors
ShowCommandHandler: the compound listings (MATERIALIZED VIEWS, DYNAMIC TABLES, FILE FORMATS, the two POLICIES) have to be recognised before the bare keyword they contain, orSHOW MATERIALIZED VIEWSwould be answered as VIEWS.
-