Skip to content

[PLUGIN-1954] Update Snowflake JDBC driver to 4.0.2 and adapt API changes#60

Open
harishhk107 wants to merge 1 commit intodata-integrations:developfrom
cloudsufi:fix/key-pair-passphrase
Open

[PLUGIN-1954] Update Snowflake JDBC driver to 4.0.2 and adapt API changes#60
harishhk107 wants to merge 1 commit intodata-integrations:developfrom
cloudsufi:fix/key-pair-passphrase

Conversation

@harishhk107
Copy link
Copy Markdown

@harishhk107 harishhk107 commented Apr 8, 2026

PLUGIN-1954

Bumps snowflake-jdbc.version from 3.14.4 to 4.0.2.

The migration to Snowflake JDBC 4.0.2 requires updating downloadStream and uploadStream calls to use the new DownloadStreamConfig and UploadStreamConfig builders

  1. Download Stream: Explicit Decompression
    Previously, the decompression behavior was controlled by a trailing boolean. This is now encapsulated within DownloadStreamConfig.

  2. Upload Stream: Encapsulated Configuration
    The legacy 5-argument uploadStream has been simplified. Metadata like destination prefixes and compression settings are now moved into UploadStreamConfig.

  3. OAuth2 Authentication Update
    -- Removed deprecated setOauthToken() method
    -- Added explicit setAuthenticator("oauth") call before setting password

  4. Configuration Validation Enhancement
    -- Added passphrase validation for key-pair authentication

https://docs.snowflake.com/en/developer-guide/jdbc/jdbc-migration#stream-upload-and-download-changes

try (Connection connection = dataSource.getConnection()) {
connection.unwrap(SnowflakeConnection.class).uploadStream(stageDir,
null,
inputStream, filename, true);
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.

why filename is removed, will it work without this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The legacy 5-argument uploadStream method with positional booleans was deprecated/removed in the 4.x driver. Migrating to the UploadStreamConfig builder explicitly handles the compression and destination prefix, making the implementation compatible with the new API

try (Connection connection = dataSource.getConnection()) {
InputStream downloadStream = connection.unwrap(SnowflakeConnection.class)
.downloadStream("@~", stageSplit, true);
.downloadStream("@~", stageSplit, null);
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.

what is the significance of this flag?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In the Snowflake JDBC 4.x driver, the legacy positional method downloadStream(String, String, boolean) has been replaced by a more explicit signature that uses the DownloadStreamConfig object.

The 'true' flag significance: -> In the original code, true was the decompress flag. This tells the driver that the file stored on the Snowflake stage is compressed (e.g., GZIP) and should be automatically decompressed by the driver before returning the InputStream to the application

@harishhk107 harishhk107 changed the title Update Snowflake JDBC driver to 4.0.2 and adapt API changes [PLUGIN-1954] Update Snowflake JDBC driver to 4.0.2 and adapt API changes Apr 8, 2026
Bumps `snowflake-jdbc.version` from `3.14.4` to `4.0.2`.
Copy link
Copy Markdown
Contributor

@itsankit-google itsankit-google left a comment

Choose a reason for hiding this comment

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

Are these changes backward compatible?

What happens if an existing pipeline gets upgraded? Does it work seemlessly?

Have we tested that?

@harishhk107
Copy link
Copy Markdown
Author

Are these changes backward compatible?

What happens if an existing pipeline gets upgraded? Does it work seemlessly?

Have we tested that?

The v4.x driver includes a legacy wrapper for the previous driver class, so existing connection logic remains backward compatible. We have successfully tested the upgrade with our current pipelines, and they continued to run seamlessly without code changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants