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

Support for new JDBC connector Snowflake #21842

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmariamgeorge
Copy link
Contributor

@dmariamgeorge dmariamgeorge commented Feb 2, 2024

Description

Snowflake database is a cloud-hosted relational database that is used to build data warehouses and combines the functions of traditional databases with new capabilities. This PR implements support for the Snowflake connector in Presto by introducing a new module presto-snowflake.

Motivation and Context

Adding support to the Snowflake connector allows querying and creating tables in an external Snowflake database through Presto. This can be used to join data between different systems like Snowflake and Hive, or between two different Snowflake accounts.

Impact

Introduces a new module presto-snowflake. Allows users to connect to external Snowflake database and query through Presto. Following statements that are checked are supported by the Snowflake connector in Presto:

Screenshot 2024-02-02 at 8 05 42 PM Screenshot 2024-02-02 at 8 03 38 PM

Addresses the issue #21843.

Test Plan

Configured the Snowflake connector, by creating a catalog properties file in etc/catalog named snowflake.properties, to mount the Snowflake connector as the snowflake catalog. Tested the following SQL statements:
queries.txt

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== RELEASE NOTES ==

General Changes

* Add new Presto connector for Snowflake.

@steveburnett
Copy link
Contributor

As this draft develops, please add documentation by adding a new file about this connector to https://github.com/prestodb/presto/tree/master/presto-docs/src/main/sphinx/connector.

@dmariamgeorge dmariamgeorge marked this pull request as ready for review February 6, 2024 06:14
@dmariamgeorge dmariamgeorge requested a review from a team as a code owner February 6, 2024 06:14
@dmariamgeorge dmariamgeorge marked this pull request as draft February 6, 2024 12:13
@dmariamgeorge dmariamgeorge force-pushed the presto-snowflake branch 2 times, most recently from 321ad6c to d5f27de Compare February 6, 2024 17:34
@dmariamgeorge dmariamgeorge marked this pull request as ready for review February 6, 2024 19:13
@dmariamgeorge dmariamgeorge changed the title Support for new connector Snowflake Support for new JDBC connector Snowflake Feb 6, 2024
@dmariamgeorge dmariamgeorge force-pushed the presto-snowflake branch 8 times, most recently from 3433d12 to 1ed0422 Compare February 15, 2024 10:16
Copy link

github-actions bot commented Feb 16, 2024

Codenotify: Notifying subscribers in CODENOTIFY files for diff d4bdf97...1547465.

Notify File(s)
@steveburnett presto-docs/src/main/sphinx/connector.rst
presto-docs/src/main/sphinx/connector/snowflake.rst

Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

Thanks for the documentation! I made a few suggestions for clarity and style, and tried to explain my reasoning. Let me know if you have any concerns about my suggestions and we'll figure out answers together.

presto-docs/src/main/sphinx/connector/snowflake.rst Outdated Show resolved Hide resolved
presto-docs/src/main/sphinx/connector/snowflake.rst Outdated Show resolved Hide resolved
presto-docs/src/main/sphinx/connector/snowflake.rst Outdated Show resolved Hide resolved
presto-docs/src/main/sphinx/connector/snowflake.rst Outdated Show resolved Hide resolved
``case-insensitive-name-matching`` Match dataset and table names case-insensitively. ``false``

``case-insensitive-name-matching.cache-ttl`` Duration for which remote dataset and table names will be
cached. Set to ``0ms`` to disable the cache. ``1m``
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a standard set of abbreviations for measurements of time in this context? This reads to me as both milliseconds and minutes are acceptable values. I searched but didn't find anything quickly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@steveburnett - Both units milliseconds and minutes are supported.

presto-docs/src/main/sphinx/connector/snowflake.rst Outdated Show resolved Hide resolved
presto-docs/src/main/sphinx/connector/snowflake.rst Outdated Show resolved Hide resolved
@steveburnett
Copy link
Contributor

To add the new documentation page to the Connectors index page in the documentation, in addition to creating the new .rst page in the /connector directory, you must also edit the connectors index page

https://github.com/prestodb/presto/blob/master/presto-docs/src/main/sphinx/connector.rst

Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

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

LGTM! (docs)
Pulled updated branch, new local build of docs. Everything looks good, thanks!

The Snowflake Connector link appears on the Connectors index page in the local build.

@dmariamgeorge dmariamgeorge marked this pull request as ready for review February 20, 2024 17:38
@skairali skairali self-requested a review February 23, 2024 06:10
@skairali skairali self-assigned this Feb 23, 2024
@skairali
Copy link
Member

This is an important connect for Presto as this will give us ability handle snowflake usecases

Copy link
Member

@skairali skairali left a comment

Choose a reason for hiding this comment

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

A need of the hour connector for presto, huge value for community

@skairali
Copy link
Member

@dmariamgeorge We need following before it to get merged

  1. Compre hensive UT
  2. Integration tests ( if possible with mocks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants