-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add Snowflake connector #17909
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 connector #17909
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # Snowflake connector | ||
|
|
||
| ```{raw} html | ||
| <img src="../_static/img/snowflake.png" class="connector-logo"> | ||
| ``` | ||
|
|
||
| The Snowflake connector allows querying and creating tables in an | ||
| external [Snowflake](https://www.snowflake.com/) account. This can be used to join data between | ||
| different systems like Snowflake and Hive, or between two different | ||
| Snowflake accounts. | ||
|
|
||
| ## Configuration | ||
|
|
||
| To configure the Snowflake connector, create a catalog properties file | ||
| in `etc/catalog` named, for example, `example.properties`, to | ||
| mount the Snowflake connector as the `snowflake` catalog. | ||
| Create the file with the following contents, replacing the | ||
| connection properties as appropriate for your setup: | ||
|
|
||
| ```none | ||
| connector.name=snowflake | ||
| connection-url=jdbc:snowflake://<account>.snowflakecomputing.com | ||
| connection-user=root | ||
| connection-password=secret | ||
| snowflake.account=account | ||
| snowflake.database=database | ||
| 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`. | ||
|
|
||
| ### Multiple Snowflake databases or accounts | ||
|
|
||
| The Snowflake connector can only access a single database within | ||
| a Snowflake account. Thus, if you have multiple Snowflake databases, | ||
| or want to connect to multiple Snowflake accounts, you must configure | ||
| multiple instances of the Snowflake connector. | ||
|
|
||
| % snowflake-type-mapping: | ||
|
|
||
| ## Type mapping | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type mapping should be separated into "Snowflake type to Trino type mapping" & "Trino type mapping to Snowflake type mapping"
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True .. but if that is not done it should not block merge .. we can clean that up after merge as well. |
||
|
|
||
| Trino supports the following Snowflake data types: | ||
|
|
||
| | Snowflake Type | Trino Type | | ||
| | -------------- | -------------- | | ||
| | `boolean` | `boolean` | | ||
| | `tinyint` | `bigint` | | ||
| | `smallint` | `bigint` | | ||
| | `byteint` | `bigint` | | ||
| | `int` | `bigint` | | ||
| | `integer` | `bigint` | | ||
| | `bigint` | `bigint` | | ||
| | `float` | `real` | | ||
| | `real` | `real` | | ||
| | `double` | `double` | | ||
| | `decimal` | `decimal(P,S)` | | ||
| | `varchar(n)` | `varchar(n)` | | ||
| | `char(n)` | `varchar(n)` | | ||
| | `binary(n)` | `varbinary` | | ||
| | `varbinary` | `varbinary` | | ||
| | `date` | `date` | | ||
| | `time` | `time` | | ||
| | `timestampntz` | `timestamp` | | ||
|
|
||
| Complete list of [Snowflake data types](https://docs.snowflake.com/en/sql-reference/intro-summary-data-types.html). | ||
|
|
||
| (snowflake-sql-support)= | ||
|
|
||
| ## SQL support | ||
|
|
||
| The connector provides read access and write access to data and metadata in | ||
| a Snowflake database. In addition to the {ref}`globally available | ||
| <sql-globally-available>` and {ref}`read operation <sql-read-operations>` | ||
| statements, the connector supports the following features: | ||
|
|
||
| - {doc}`/sql/insert` | ||
| - {doc}`/sql/delete` | ||
| - {doc}`/sql/truncate` | ||
| - {doc}`/sql/create-table` | ||
| - {doc}`/sql/create-table-as` | ||
| - {doc}`/sql/drop-table` | ||
| - {doc}`/sql/alter-table` | ||
| - {doc}`/sql/create-schema` | ||
| - {doc}`/sql/drop-schema` | ||
Uh oh!
There was an error while loading. Please reload this page.