fix(snowflake): handle DollarString in PUT/FROM and UUID paths in stage references#191
Merged
Merged
Conversation
…ge references - Accept DollarString (79193...79193) as PUT target stage reference - Stop PUT source path consumption at DollarString boundary - Accept DollarString as table source in SELECT FROM (Snowflake stage paths) - Allow Number and Dash tokens in stage path segments for UUID-style paths (@~/uuid-xxx/name, @stage/uuid-xxx) - Change path segment consumption from single-token (if) to multi-token (while) loops to handle composite paths like c8b31cea-a6d1-4413 Fixes JDBC-generated SQL patterns: PUT file:///tmp/f $$@%"ice cream"$$ overwrite=true SELECT $1 FROM $$@%"ice cream"/$$ PUT file:///tmp/f @~/00626646-bb1e-4729-a1ab-d4b96/testUpload overwrite=true PUT file:///tmp/f.csv @stage/c8b31cea-a6d1-4413 AUTO_COMPRESS=FALSE Related: tobilg#164, tobilg#165
tobilg
added a commit
that referenced
this pull request
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 10 SQL parse failures from the Snowflake JDBC driver (v4.0.2) test suite by adding support for dollar-quoted strings in PUT/FROM statements and UUID-style path segments in stage references.
Changes
1. DollarString support in PUT statements
The JDBC driver wraps stage references with special characters in
$$...$$(dollar-quoted strings):Fix:
DollarStringtoken boundaryDollarStringas a valid stage reference (alongsideStringandParameter)2. DollarString support in FROM clause
The JDBC driver uses dollar-quoted stage paths in
SELECT FROM:Fix: The FROM-clause table parser now accepts
DollarStringas a valid table source, similar to how it already acceptsStringfor DuckDB.3. UUID-style path segments in stage references
JDBC-generated PUT statements use UUID-based paths for upload operations:
Root cause: UUIDs tokenize as
Number+Dash+Identifier+Dashetc. The path consumption loops inparse_stage_reference_as_stringonly acceptedVar, keywords, and identifiers.Fix:
NumberandDashto accepted token types in all 3 path-segment loops (user stage@~, named stage@name, and Var-style@var)if) to multi-token (while) loops to handle composite UUID segments likec8b31cea-a6d1-4413Test Results
Errors Resolved
PUT ... $$@%"ice cream"$$ ...SELECT $1 FROM $$@%"..."$$PUT ... @~/UUID/testUpload ...PUT ... @~/UUID/testCompress ...PUT ... @~/UUID/testUpload ...PUT ... @stage/UUID AUTO_COMPRESS=FALSEPUT ... @stage/UUID AUTO_COMPRESS=FALSEPUT ... @stage/UUID AUTO_COMPRESS=TRUEPUT ... @stage/UUID AUTO_COMPRESS=TRUERelated