-
Notifications
You must be signed in to change notification settings - Fork 3k
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 Apache Phoenix connector #76
Conversation
Thanks @vincentpoon. We're going to start looking at this shortly. In the meantime, please make sure to sign the CLA so we can get your code merged. |
@cla-bot check |
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.
Just skimmed.
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/TestingPhoenixServer.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/TestPhoenixDistributedQueries.java
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/PhoenixQueryRunner.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/PhoenixQueryRunner.java
Outdated
Show resolved
Hide resolved
Thanks for the initial review @kokosing , I've just pushed fixes to most of your suggestions and more cleanup. |
@combineads Can you submit the CLA? https://github.com/prestosql/cla |
@vincentpoon please squash your commits into single commit. Place yourself as the commit author (
|
@findepi Done, thanks for the suggestion |
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.
Good job!
I just skimmed the code.
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixConfig.java
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixConfig.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/PhoenixQueryRunner.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/PhoenixQueryRunner.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/TestPhoenixDistributedQueries.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/TestingPhoenixServer.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/TestingPhoenixServer.java
Outdated
Show resolved
Hide resolved
Thanks for the detailed review @findepi , just posting to give an update that I'm still working on a new revision. |
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.
@vincentpoon Thanks for contributing this. Please let us know when the new revision is ready. Feel free to message me on Slack if you have any questions.
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
Still working on this :) |
@vincentpoon |
I've pushed a new revision. Would appreciate you taking a looking. At the core, what we're doing is pretty simple - generate Phoenix splits (HBase scans) and wrap them in a ResultSet, and from then on treat each split as if it were from a jdbc connector. I did have to drop a few things, though: 1) ARRAY type, which I hope to complete as a broader patch in #317, 2) DELETE, which doesn't appear to be implemented for JDBC yet, and 3) Phoenix ON DUPLICATE KEY support. Other notables: Connection properties are now read from a separate hbase-site.xml, which is the way it's typically done in Phoenix deployments. The phoenix.rst is cleaned up - I shortened all the descriptions and provided a link instead, as all the properties would generally be familiar to Phoenix/HBase users and more information can be found on the Phoenix/HBase websites anyways. Thanks! |
presto-phoenix/pom.xml
Outdated
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.phoenix</groupId> | ||
<artifactId>presto-phoenix-client-shaded</artifactId> |
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.
Nice, thank you!
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/MetadataUtil.java
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/MetadataUtil.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixClient.java
Outdated
Show resolved
Hide resolved
Thanks @kokosing , updated to address your comments |
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixMetadata.java
Show resolved
Hide resolved
This phoenix connector occurs the below error when using 4.14.0-cdh5.14.2 phoenix version.
|
@combineads I guess you have to run it with the latest build of presto. I guess there is a recent changes added to the |
If this is ready for another review, can you resolve the conflict in the |
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixConfig.java
Outdated
Show resolved
Hide resolved
I noticed now that when I add a table in Phoenix without a schema that Indeed BaseJdbcClient.getSchemaNames() expects that resultSet.getString("TABLE_SCHEM") always returns something non-null, which is not correct according to the JDBC documentation. (TABLE_SCHEM might be null).
Locally I fixed it by trivially by copying the BaseJdbcClient.getSchemaNames() code into PhoenixClient (and add the DEFAULT_SCHEMA). |
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/MetadataUtil.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixSplitManager.java
Outdated
Show resolved
Hide resolved
presto-phoenix/src/main/java/io/prestosql/plugin/phoenix/PhoenixTableLayoutHandle.java
Show resolved
Hide resolved
presto-phoenix/src/test/java/io/prestosql/plugin/phoenix/PhoenixQueryRunner.java
Outdated
Show resolved
Hide resolved
I would also consider to squash all the commits and open a new PR. This one already has more than 200 of comments and github is getting slow. |
Based on @combineads (Byunghwa Yun <[email protected]>) published at prestodb/presto#12111.
Pushed another update that addresses the comments. Also, this now uses the official phoenix-client, instead of the custom shaded jar we were producing for Presto. It required a few changes to the pom.xml |
Closed this since GitHub was loading slowly with this many comments. Continuing at #672 |
… SET SESSION/RESET SESSION.
… SET SESSION/RESET SESSION.
https://phoenix.apache.org/
Ref prestodb/presto#12111