Skip to content

Snowflake: parse nested COPY transformation paths - #29

Merged
osipovartem merged 1 commit into
embucket-sync-df55.0.0from
snowflake-copy-nested-path
Sep 16, 2026
Merged

osipovartem merged 1 commit into
embucket-sync-df55.0.0from
snowflake-copy-nested-path

Conversation

@osipovartem

Copy link
Copy Markdown

Summary

Allow Snowflake COPY INTO ... FROM (SELECT ...) transformations to parse staged fields followed by nested semi-structured paths or casts, for example:

SELECT $1:continent::VARCHAR, $1:country:name::VARCHAR
FROM @sf_tut_stage/cities.parquet

The dedicated StageLoadSelectItem parser remains the fast path for simple $1:key items. When more path/cast tokens follow, speculative parsing now rolls back to the standard expression parser so the complete JsonAccess / Cast AST is preserved.

Validation

  • cargo test --test sqlparser_snowflake: 169/169
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

The regression query is based on Snowflake's documented Parquet COPY transformation syntax:
https://docs.snowflake.com/en/user-guide/tutorials/script-data-load-transform-parquet

@osipovartem
osipovartem merged commit 4912f72 into embucket-sync-df55.0.0 Sep 16, 2026
19 checks passed
@osipovartem
osipovartem deleted the snowflake-copy-nested-path branch September 16, 2026 10:22
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.

1 participant