Skip to content

Fixed stage name parsing for snowflake - #2265

Merged
iffyio merged 3 commits into
apache:mainfrom
romanoff:fix_stage_name_parsing_for_snowflake
Mar 13, 2026
Merged

Fixed stage name parsing for snowflake#2265
iffyio merged 3 commits into
apache:mainfrom
romanoff:fix_stage_name_parsing_for_snowflake

Conversation

@romanoff

@romanoff romanoff commented Mar 4, 2026

Copy link
Copy Markdown

Fixed special characters in stage name parsing for snowflake
Example queries:

SELECT * FROM @stage/day=18/23.parquet;
SELECT * FROM @stage/0:18:23/23.parquet;

Spec: https://docs.snowflake.com/en/user-guide/querying-stage

Comment thread tests/sqlparser_snowflake.rs Outdated
fn test_snowflake_stage_name_with_special_chars() {
// Stage path with '=' (Hive-style partitioning)
let sql = "SELECT * FROM @stage/day=18/23.parquet";
let stmt = snowflake().parse_sql_statements(sql).unwrap();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we use the one_statement_parse_to (or verified_stmt if that works) for the tests?

@romanoff

romanoff commented Mar 9, 2026

Copy link
Copy Markdown
Author

@iffyio Updated. Thank you

@iffyio iffyio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks @romanoff!

@iffyio
iffyio added this pull request to the merge queue Mar 13, 2026
Merged via the queue into apache:main with commit 9d5a171 Mar 13, 2026
10 checks passed
sabir-akhadov-localstack added a commit to localstack/datafusion-sqlparser-rs that referenced this pull request Aug 24, 2026
… ROLES (apache#2265)

* Task LAV-1788: CREATE/ALTER ROLE COMMENT round-trips through SHOW ROLES

Parse Snowflake CREATE ROLE ... COMMENT = '...', thread the comment
through the create_role UDF, and add the is_from_organization_user_group
column (11th) to SHOW ROLES plus a SHOW TERSE ROLES projection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Task LAV-1788: assert full 11-column SHOW ROLES in create-role-comment test

The new test stripped is_from_organization_user_group with a stale
'emulator omits' comment, papering over the very column this task adds
(the emulator does emit it — see test_show_roles). Drop the strip and
assert the column (constant 'N') across the round-trip instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Task LAV-1788: waive test_rbac re-record; verified is_inherited drift

* Task LAV-1788: assert 11-column SHOW ROLES in rename/unset/limit tests

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Task LAV-1788: respect INITIALIZE=ON_SCHEDULE in dynamic-table scheduler

The refresh scheduler treated any never-refreshed ACTIVE dynamic table as
immediately due, refreshing ON_SCHEDULE tables on the next poll tick despite
their create-time contract (created empty until the first scheduled refresh).
test_dynamic_tables_never_refreshed raced this poll and flaked under parallel
load. Anchor a never-refreshed ON_SCHEDULE table's first due time at
created_at + TARGET_LAG; other never-refreshed tables stay due immediately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <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.

2 participants