Java and Python UDFs and stored procedures: Changes to handling of // when resolving file paths in file access APIs (Preview)

Attention

This behavior change is in the 2025_03 bundle.

For the current status of the bundle, refer to Bundle History.

Snowflake currently removes // when you provide it between the stage and path name. However this is ambiguous because cloud storage allows forward slashes (/) in path names. The original goal was to help users who mis-concatenate their names (for example, build_scoped_file_url(@stage, '/file.txt')) which would result in @stage//file.txt when the user really wanted @stage/file.txt. When this behavior change bundle is enabled, Snowflake removes this behavior to avoid ambiguity.

So with this behavior change, resolutions to @stage//file.txt will fail unless /file.txt exists on cloud storage.

Before the change:

For files resolved inside a UDF or stored procedure:

  • @stage//file.txt resolves to stage-location/file.txt

  • build_scoped_url(@stage, '//file.txt') resolves to stage-location/file.txt

After the change:

For files resolved inside a UDF or stored procedure:

  • @stage//file.txt resolves to stage-location//file.txt

  • build_scoped_url(@stage, '//file.txt') resolves to stage-location//file.txt

Ref: 1810