Skip to content

GRANT ON WAREHOUSE not recognized (Snowflake) #108

@devmaha

Description

@devmaha

Component: crates/polyglot-sql/src/parser.rs
Dialect: Snowflake

Description:
Snowflake GRANT USAGE ON WAREHOUSE warehouse_name TO ROLE role_name is standard Snowflake access control syntax. The GRANT parser does not recognize WAREHOUSE as a valid object type after ON.

Example SQL:
sqlGRANT USAGE ON WAREHOUSE compute_wh TO ROLE analyst;

Expected behavior:
Parse succeeds. No tables extracted (warehouse is not a table).

Actual behavior:
parse_sql returns ParseError: "Expected To, got Var ('compute_wh')" — the parser treats WAREHOUSE as the object name and compute_wh as unexpected.

Root cause:
The GRANT parser's ON <object_type> handler recognizes TABLE, SCHEMA, DATABASE, FUNCTION, PROCEDURE, SEQUENCE, VIEW but not WAREHOUSE, STAGE, INTEGRATION, or other Snowflake-specific object types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions