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.
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.