Skip to content

Snowflake: Add CREATE and DROP EXTERNAL VOLUME - #2475

Open
sabir-akhadov-localstack wants to merge 2 commits into
apache:mainfrom
localstack:pr/05-external-volume
Open

sabir-akhadov-localstack wants to merge 2 commits into
apache:mainfrom
localstack:pr/05-external-volume

Conversation

@sabir-akhadov-localstack

Copy link
Copy Markdown
Contributor

Snowflake's CREATE EXTERNAL VOLUME and DROP EXTERNAL VOLUME did not parse. Example that failed before:

CREATE EXTERNAL VOLUME my_vol STORAGE_LOCATIONS = (
    (NAME = 'loc1' STORAGE_PROVIDER = 'S3' STORAGE_BASE_URL = 's3://bucket/path/'));

This adds CREATE [OR REPLACE] EXTERNAL VOLUME [IF NOT EXISTS] and DROP EXTERNAL VOLUME (mirroring the merged CREATE/DROP WAREHOUSE, #2388). Each storage location is a parenthesized key-value option list parsed generically into the existing KeyValueOptions, so fields (including the nested ENCRYPTION = (...) list) may appear in any order, matching real Snowflake. Only an empty location is rejected; semantic checks such as the required STORAGE_BASE_URL or duplicate fields are left to the consumer, in line with the parser's permissive stance. The trailing ALLOW_WRITES and COMMENT properties are accepted in either order. DROP EXTERNAL VOLUME reuses the generic Statement::Drop via a new ObjectType::ExternalVolume. All statements round-trip.

See the Snowflake CREATE EXTERNAL VOLUME docs.

Replaces #2397, split into four PRs per review feedback — this one plus ALTER (#2474), DESC (#2472) and SHOW (#2473).

@sabir-akhadov-localstack

Copy link
Copy Markdown
Contributor Author

Rebased on latest main. @iffyio @LucaCappelletti94 could you take a look when you have a moment? This is the first of the PRs split out of #2397 (#2472 and #2473 are the others; #2474 is stacked on this one).

@codecov-commenter

codecov-commenter commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.78082% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.42%. Comparing base (1ea2488) to head (2ec07ae).

Files with missing lines Patch % Lines
src/ast/mod.rs 77.77% 1 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2475      +/-   ##
==========================================
+ Coverage   81.38%   81.42%   +0.04%     
==========================================
  Files          42       42              
  Lines       34110    34182      +72     
  Branches    34110    34182      +72     
==========================================
+ Hits        27761    27834      +73     
+ Misses       2785     2780       -5     
- Partials     3564     3568       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebasing The PR has collisions with main and requires rebasing Snowflake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants