Skip to content

Commit

Permalink
Verify JVM configuration in Snowflake connector
Browse files Browse the repository at this point in the history
Snowflake connector uses Arrow which requires additional JVM arguments.
The docs were also incorrect, Arrow is always used unconditionally in
the Snowflake connector.
  • Loading branch information
hashhar committed Jan 15, 2025
1 parent ce3c487 commit 3be054f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 3 additions & 9 deletions docs/src/main/sphinx/connector/snowflake.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,9 @@ snowflake.role=role
snowflake.warehouse=warehouse
```

### Arrow serialization support

This is an experimental feature which introduces support for using Apache Arrow
as the serialization format when reading from Snowflake. Please note there are
a few caveats:

- Using Apache Arrow serialization is disabled by default. In order to enable
it, add `--add-opens=java.base/java.nio=ALL-UNNAMED` to the Trino
{ref}`jvm-config`.
Snowflake connector uses Apache Arrow as the serialization format when
reading from Snowflake which requires additional JVM arguments. Add
`--add-opens=java.base/java.nio=ALL-UNNAMED` to the Trino {ref}`jvm-config`.

### Multiple Snowflake databases or accounts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
*/
package io.trino.plugin.snowflake;

import com.google.common.collect.ImmutableMultimap;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provides;
import com.google.inject.Scopes;
import com.google.inject.Singleton;
import io.opentelemetry.api.OpenTelemetry;
import io.trino.plugin.base.JdkCompatibilityChecks;
import io.trino.plugin.jdbc.BaseJdbcConfig;
import io.trino.plugin.jdbc.ConnectionFactory;
import io.trino.plugin.jdbc.DriverConnectionFactory;
Expand Down Expand Up @@ -46,6 +48,11 @@ public class SnowflakeClientModule
@Override
public void configure(Binder binder)
{
// Check reflective access allowed - required by Apache Arrow usage in Snowflake JDBC driver
JdkCompatibilityChecks.verifyConnectorAccessOpened(
binder,
"snowflake",
ImmutableMultimap.of("java.base", "java.nio"));
binder.bind(JdbcClient.class).annotatedWith(ForBaseJdbc.class).to(SnowflakeClient.class).in(Scopes.SINGLETON);
configBinder(binder).bindConfig(SnowflakeConfig.class);
configBinder(binder).bindConfig(TypeHandlingJdbcConfig.class);
Expand Down

0 comments on commit 3be054f

Please sign in to comment.