Class WarehouseReference

java.lang.Object
dev.frostlake.executor.WarehouseReference

public final class WarehouseReference extends Object
Refusing a statement that names a warehouse which is not there.

Snowflake validates the reference at CREATE time, and phrases the refusal TWO different ways — live-verified, both against the same missing warehouse:

 CREATE TASK … WAREHOUSE = nosuch_wh            -> Nonexistent warehouse NOSUCH_WH was specified.
 CREATE DYNAMIC TABLE … WAREHOUSE = nosuch_wh   -> Warehouse 'NOSUCH_WH' does not exist.
 CREATE CORTEX SEARCH SERVICE … WAREHOUSE = …   -> Warehouse 'NOSUCH_WH' does not exist.
 

Note what is NOT validated: CREATE USER … DEFAULT_WAREHOUSE = nosuch_wh is ACCEPTED, so a blanket rule over every warehouse-shaped property would be stricter than Snowflake. Only the statements measured above check.

  • Method Details

    • requireForTask

      public static void requireForTask(Catalog catalog, String warehouse)
      The TASK phrasing: the name bare and upper-cased, no quotes, and no SQL compilation error: prefix — a task's warehouse check is not a compilation error live.
    • require

      public static void require(Catalog catalog, String warehouse)
      The phrasing every other statement uses. Deliberately NOT SqlCompilationError.doesNotExist(java.lang.String, java.lang.String): that shape ends "does not exist or not authorized." and opens with a "SQL compilation error:" line, and this message has neither — measured verbatim as Warehouse 'NOSUCH_WH' does not exist.