apache / apache/drill

Snowflake - adopt JDBC parameter CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX

Open
#2,324 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
2k
Forks
990
Avg merge
1d 8h
Merged PRs (30d)
5

Description

**Is your feature request related to a problem? Please describe.**
I specify JDBC URL like this:
`jdbc:snowflake://.snowflakecomputing.com:443?warehouse=&db=&CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX=true`

Despite I use CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX=true , INFORMATION_SCHEMA.SCHEMATA contains schemata from all warehouses and databases (the user has access to everywhere).

In our platform, when I use this parameter and I call e.g. dbMetadata.getTables() , it collects only tables from corresponding warehouse and database.

Querying all warehouses can be very expensive causing SELECT from Drill INFORMATION_SCHEMA takes ages.

**Describe the solution you'd like**
Parameter CLIENT_METADATA_REQUEST_USE_CONNECTION_CTX is properly propagated to the connection from Drill to Snowflake, only objects from warehouse/database specified in the JDBC URL are populated into Drill INFORMATION_SCHEMA.

**Describe alternatives you've considered**
The only workaround solution is to limit privileges of DB user (what warehouses/databases he can see). This is not a valid workaround in our case (testing user has read access to huge number of testing warehouses/databases).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.