Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Snowflake to native-image #12193

Merged
merged 3 commits into from
Feb 3, 2025
Merged

Conversation

hubertp
Copy link
Collaborator

@hubertp hubertp commented Jan 30, 2025

Pull Request Description

This change adds Snowflake's jdbc library packaged in a fat jar.
Closes #12151.

Important Notes

It's not a straightforward inclusion mostly due to the complicated way how the jar itself is constructed:

  • it's a fat jar so includes other dependencies which we sometimes already include (possibly room for improvement, if we are willing to risk some incompatibilities)
  • they are patching some of the dependencies and putting them under their subpackage making it impossible to use the snowflake-jdbc-thin dependency
  • a number of configs are spurious and need to be disabled
  • FileTypeDetector provider leads to runtime-/build-time initialization conflict that is impossible to workaround without disabling it
  • need to open java.base module, similarly to Open Java modules for Snowflake setup #9664, due to Arrow's usage
  • java.nio.DirectByteBuffer constructor changed its signature in JDK21 from (long, int) to (long, long) which caused problems for the constructed NI and needed to be reflected in the config

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label Jan 30, 2025
This change adds Snowflake's jdbc library packaged in a fat jar.

It's not a straightword inclusion mostly due to the complicated way how
the jar itself is constructed:
- it's a fat jar so includes other dependencies which we sometimes
  include
- they are patching some of the dependencies and putting them under
  their subpackage making it impossible to use the `snowflake-jdbc-thin`
dependency
- a number of configs are spurious and need to be disabled
- `FileTypeDetector` provider leads to runtime-/build-time
  initialization confict that is impossible to workaround without
disabling it
- need to open `java.base` module, similarly to #9664, due to Arrow's
  usage
- `java.nio.DirectByteBuffer` constructor changed its signature in JDK21  from
  `(long, int)` to `(long, long)` which caused problems for the
constructed NI and needed to be reflected in the config
@hubertp hubertp force-pushed the wip/hubert/12151-ni-snowflake branch from f2b73b0 to cb6fa59 Compare January 30, 2025 13:16
@@ -714,6 +714,12 @@ pub async fn runner_sanity_test(
.run_ok()
.await;

let test_snowflake = Command::new(&enso)
Copy link
Member

@JaroslavTulach JaroslavTulach Feb 3, 2025

Choose a reason for hiding this comment

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

@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label Feb 3, 2025
@jdunkerley jdunkerley added the CI: Keep up to date Automatically update this PR to the latest develop. label Feb 3, 2025
@jdunkerley jdunkerley removed the CI: Keep up to date Automatically update this PR to the latest develop. label Feb 3, 2025
@mergify mergify bot merged commit e1a5a23 into develop Feb 3, 2025
49 of 52 checks passed
@mergify mergify bot deleted the wip/hubert/12151-ni-snowflake branch February 3, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include Standard.Snowflake in native image
4 participants