-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 JDBC Connector #10387
Add Snowflake JDBC Connector #10387
Conversation
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: YU Teng.
|
Does Snowflake allow partitioning, or expose any partition information (like the Phoenix connector, which is also JDBC based). Without partitioning you'll get a single split per query, which might work for small, highly selective, or aggregate queries (assuming pushdown is implemented, see below), but not if you are actually pulling a lot of data from Snowflake for example when you want to retrieve a large dataset or Trino is unable to push a predicate or aggregation into the connector. Related... Trino base jdbc will automatically do most predicate pushdown, but you'll have to add aggregate pushdown (you can see in the Postgres connector how to do that). |
In fact, just as the first comment mentioned that I started to add the snowflake support to the trino repository with #2551 , but there are some function code which is out of date, so I restarted and updated it to the latest version with my colleague. Currently, I'm still working on the test and facing some problems. Because Snowflake can't be dokerized, I can't learn the standard way with the library In fact, with my latest commit, it can pass my use case of snowflake on trino by deploying a custom plugin. So it lacks of tests to be merged in trino. 😄 I would be grateful if you could help me with the test. |
acb1500
to
b4c11f4
Compare
Hello team, I added the tests for the snowflake. It is ready for next review.😄 |
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeClientModule.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeConfig.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/SnowflakeQueryRunner.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestSnowflakeConnectorTest.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestSnowflakeTypeMapping.java
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestingSnowflakeServer.java
Outdated
Show resolved
Hide resolved
58e7b39
to
02a88af
Compare
@yuuteng Apologies for not chiming in here sooner; I started working on this connector a long time ago and my work priorities changed in the meantime so I never got the time to take it to a mergeable state. You have my blessing (not that you need it!) to take over this feature; I think it will be a great addition to the project. Thank you! 🙂 |
@pgagnon Thank you for your reply. Don't worry. I will get it right this time.😄 Thanks for your work, it really helps a lot. |
e35548d
to
050bb8d
Compare
Hello, I just pushed my new commit for resolving all the point which you mentioned in the last review:微笑: I was struggled to make all the tests pass, but there were still some tests failed which I don’t well understand, so I left some TODO for them. And now all tests are passed or skipped. Ready for the next review 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check CI failure.
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestSnowflakeTypeMapping.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestSnowflakeTypeMapping.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestingSnowflakeServer.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestingSnowflakeServer.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestingSnowflakeServer.java
Outdated
Show resolved
Hide resolved
6ed326b
to
3384b6c
Compare
9e8b282
to
4e0b811
Compare
Hello, I just organized my commits. It is ready for the next review. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some previous comments aren't yet addressed. Let me know once it's finished.
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/main/java/io/trino/plugin/snowflake/SnowflakeClient.java
Outdated
Show resolved
Hide resolved
plugin/trino-snowflake/src/test/java/io/trino/plugin/snowflake/TestSnowflakeConnectorTest.java
Show resolved
Hide resolved
6cbdd0e
to
5347936
Compare
This reverts commit 82f9eb3f3811e8d90a482f5359e98e7c729afa17.
Fully tested with Trino 406. Untested with 410.
Adding --add-opens to enable support for Apache Arrow via shared memory buffers.
TODO: testDataMappingSmokeTest: time and timestamp testSetColumnTypes: time and timestamp
Given that a concerted effort is now in place .. should we close this PR? |
We were kind of waiting on @dprophet's new PR but no real reason to keep this open. |
Ok, because this pull request has been merged with the branch of bloomberg. So I will close this pull request and wait the new pull request from the branch above. |
Do we know when this feature MR will be created approx. by bloomberg or where is this currently blocked? My project would need to connect our Snowflake and this is blocking me right now. Or did you find another intermediate solution to connect to Snowflake? |
@dprophet are those tests almost complete? IIRC that's the only main blocker but it was a big one (not just fixing a some test code but getting Trino/Snowflake to work together well with some type conversion issues. |
Hello, this is my first time to do a commit to an open source repository. I'm a bit nervous and excited. 😄
In fact, I would like to continue the work of #2551 to add the support of snowflake in trino. And I updated some
import
and fixed some code style problems.