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

Open Java modules for Snowflake setup #9664

Merged
merged 7 commits into from
Apr 16, 2024

Conversation

hubertp
Copy link
Collaborator

@hubertp hubertp commented Apr 9, 2024

Pull Request Description

In the absence of other workarounds we need to ensure that every Java process is started with extra options:
--add-opens=java.base/java.nio=ALL-UNNAMED
Verified locally. Note: this only affects LS and cli will continue to crash on examples using Snowflake.
Tested manually.

Closes #9475.

Important Notes

Some workarounds are being considered but we need this change sooner than later.

Checklist

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

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

In the absence of other workarounds we need to ensure that every Java
process is started with extra options:
`--add-opens=java.base/java.nio=ALL-UNNAMED`
Verified locally. Note: this only affects LS and cli will continue to
crash on examples using Snowflake.

Closes #9475.
@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label Apr 9, 2024
@radeusgd
Copy link
Member

Note: this only affects LS and cli will continue to crash on examples using Snowflake.

I think I don't understand. Does this not affect the launcher as well? If I use enso run, I guess that should also use the default settings, no?

@JaroslavTulach
Copy link
Member

JaroslavTulach commented Apr 11, 2024

Btw. the proper way to address the needs of Snowflake JDBC driver is to load each library's JAR files as a separate ModuleLayer and use ModuleLayer.Controller to open the necessary packages only to Snowflake library.

@Akirathan
Copy link
Member

Btw. the proper way to address the needs of Snowflake JDBC driver is to use load each library's JAR files as a separate ModuleLayer and use ModuleLayer.Controller to open the necessary packages only to Snowflake library.

Tracked in #7082

@hubertp
Copy link
Collaborator Author

hubertp commented Apr 11, 2024

Note: this only affects LS and cli will continue to crash on examples using Snowflake.

I think I don't understand. Does this not affect the launcher as well? If I use enso run, I guess that should also use the default settings, no?

You can always prefix enso run with JAVA_OPTS="--add-opens=java.base/java.nio=ALL-UNNAMED".

Having said that, I will add it to the script by default, for convenience.

@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label Apr 11, 2024
@hubertp hubertp added the CI: Clean build required CI runners will be cleaned before and after this PR is built. label Apr 16, 2024
@mergify mergify bot merged commit d6f7afc into develop Apr 16, 2024
35 of 36 checks passed
@mergify mergify bot deleted the wip/hubert/9475-enable-arrow-snowflake branch April 16, 2024 21:01
hubertp added a commit that referenced this pull request 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 mentioned this pull request Jan 30, 2025
2 tasks
hubertp added a commit that referenced this pull request 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
mergify bot pushed a commit that referenced this pull request Feb 3, 2025
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 #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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. 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.

Enable Apache Arrow for improved Snowflake integration
4 participants