Skip to content

Fix queries classified as Unknown statement type by updating parsing dialect=snowflake#170

Merged
sfc-gh-twhite merged 1 commit into
Snowflake-Labs:mainfrom
edmundyan:eyan/dialect_snowflake
Apr 1, 2026
Merged

Fix queries classified as Unknown statement type by updating parsing dialect=snowflake#170
sfc-gh-twhite merged 1 commit into
Snowflake-Labs:mainfrom
edmundyan:eyan/dialect_snowflake

Conversation

@edmundyan
Copy link
Copy Markdown
Contributor

sqlglot.parse_one() was called without a dialect, so Snowflake's ::type cast syntax caused a ParseError. This resulted in queries using colon-path access with a cast (e.g. v:key::string) being classified as Unknown and rejected by sql_statement_permissions, even when Select was explicitly allowed.

Fix: pass indialect="snowflake"

@sfc-gh-twhite sfc-gh-twhite self-requested a review April 1, 2026 14:50
Copy link
Copy Markdown
Collaborator

@sfc-gh-twhite sfc-gh-twhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Dialect specification will help a lot here. There are also other PRs that address this, will be going through #173 and #179 as well.

This Closes #174

@arborluke
Copy link
Copy Markdown

Looks like pre-commit failed, can we get that fixed so this can be relased. Thanks @sfc-gh-twhite

elipollak added a commit to elipollak/mcp that referenced this pull request Apr 2, 2026
…t test coverage

Add tests for Snowflake-specific syntax not covered by Snowflake-Labs#170: COPY INTO,
LATERAL FLATTEN, nested dot-path notation, bracket notation,
OBJECT_CONSTRUCT, and GET_PATH. Also add Copy to the README permissions
example so users can configure it explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
elipollak added a commit to elipollak/mcp that referenced this pull request Apr 2, 2026
…t test coverage

Add tests for Snowflake-specific syntax not covered by Snowflake-Labs#170: COPY INTO,
LATERAL FLATTEN, nested dot-path notation, bracket notation,
OBJECT_CONSTRUCT, and GET_PATH. Also add Copy to the README permissions
example so users can configure it explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
elipollak added a commit to elipollak/mcp that referenced this pull request Apr 2, 2026
…t test coverage

Add tests for Snowflake-specific syntax not covered by Snowflake-Labs#170: COPY INTO,
LATERAL FLATTEN, nested dot-path notation, bracket notation,
OBJECT_CONSTRUCT, and GET_PATH. Also add Copy to the README permissions
example so users can configure it explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sfc-gh-twhite pushed a commit that referenced this pull request Apr 2, 2026
…t test coverage (#173)

Add tests for Snowflake-specific syntax not covered by #170: COPY INTO,
LATERAL FLATTEN, nested dot-path notation, bracket notation,
OBJECT_CONSTRUCT, and GET_PATH. Also add Copy to the README permissions
example so users can configure it explicitly.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants