-
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 Oracle connector #1959
Add Oracle connector #1959
Conversation
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleConfig.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleConfig.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/test/java/io/prestosql/plugin/oracle/TesOraclePlugin.java
Outdated
Show resolved
Hide resolved
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.
Thanks for creating this PR. Left some initial comments.
Please fix the code style error.
[ERROR] src/main/java/io/prestosql/plugin/oracle/OracleClient.java:[26,8] (imports) UnusedImports: Unused import - io.prestosql.spi.type.TypeManager.
[ERROR] src/main/java/io/prestosql/plugin/oracle/OracleClient.java:[120] (regexp) RegexpMultiline: Blank line before closing brace
[ERROR] src/main/java/io/prestosql/plugin/oracle/OracleClient.java:[120] (regexp) RegexpMultiline: Multiple consecutive blank lines
Also, we need to add oracle.rst
in presto-docs module and update connector.rst
.
Please update the commit message as "Add Oracle connector" because we don't use past-tense. The detailed guideline is here https://github.com/prestosql/presto#development.
@ebyhr all done.. |
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClientModule.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClientModule.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleConfig.java
Outdated
Show resolved
Hide resolved
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.
You can squash commits unless rebasing branch with upstream because GitHub provides us force-pushed diff. Also, please do rebase instead fo merge-commit to track upstream branch so that we can confirm the actual diff.
@ebyhr change all the comments.. rebased and squash the commits |
@eskabetxe By the way, I would invite you to the community Slack. https://prestosql.io/slack.html There is #dev channel for Presto developers. |
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClientModule.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClientModule.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/test/java/io/prestosql/plugin/oracle/OracleServer.java
Outdated
Show resolved
Hide resolved
Two major bullets:
cc @martint |
Hi @findepi, and for the license of jar, if not compatible I can do what you say without problem, is there any example I can follow? |
@eskabetxe, the plugin built successfully, however, when using this Oracle plugin in presto, got the following errors: presto> show schemas from rdsoracle; Query 20200401_235740_00020_pdzzb, FAILED, 6 nodes Query 20200401_235740_00020_pdzzb failed: Unable to start the Universal Connection Pool: oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource: java.sql.SQLException: ORA-01017: invalid username/password; logon denied What do we need to set up in the Oracle catalog properties file? |
@eskabetxe, I guess it's because I'm trying to integrate this Oracle pool into version 331. This connection pool is however based upon version 332 snapshot, which base JDBC connectors have changed including the CredentialProvider class. |
@RugratsJ I would recommend joining Community Slack so that we can talk quickly. |
@ebyhr, in which channel on https://prestosql.io/slack.html ? |
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.
@eskabetxe Could you confirm the CI failure? Added code or 0c13d16 might break it. How about separating PR to introduce a connection pool?
@eskabetxe, @ebyhr, I think it's because the user and password didn't get set when creating the pds object. We will need to read from the config file for user and password when creating the PDS. I added this logic in startConnectionPool function, now it's working. |
@eskabetxe I couldn't select tables created by CTAS statement by default. It seems case-sensitivity affected it. While we can access it by CTAS presto> create table oracle.tpch.test_ctas as select * from (values ('a')) as t(c1);
CREATE TABLE: 1 row
presto> select * from oracle.tpch.test_ctas;
Query 20200403_112116_00032_fwtga failed: line 1:15: Table 'oracle.tpch.test_ctas' does not exist
presto> show tables in oracle.tpch;
Table
-----------
test_ctas Oracle side SQL> SELECT owner, status, table_name FROM all_tables where table_name = 'test_ctas';
OWNER STATUS TABLE_NAME
------------------------------ -------- ------------------------------
TPCH VALID test_ctas CREATE TABLE presto> create table oracle.tpch.test5 (c1 int);
CREATE TABLE
presto> select * from oracle.tpch.test5;
c1
----
(0 rows)
|
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Outdated
Show resolved
Hide resolved
Do we have updated Oracle connector that integrated with Presto version 332? |
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.
Thanks for raising this PR!!
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClientModule.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/test/java/io/prestosql/plugin/oracle/OracleServer.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/io/prestosql/plugin/oracle/OracleClient.java
Show resolved
Hide resolved
testDataMappingSmokeTest failed due to mapping between REAL and DOUBLE SELECT id FROM presto_tmp_609132480497 WHERE rand() = 42 OR value = REAL '567.123' presto_tmp_609132480497 has double type (≠real). Recently, we replaced CREATE TABLE with CTAS in this test method and the change affected it. The populated value between CT and CTAS is different in this PR ( I suppose we need additional REAL type mapping. |
@ebyhr fixed.. |
presto-oracle/src/test/java/io/prestosql/plugin/oracle/TestOracleIntegrationSmokeTest.java
Outdated
Show resolved
Hide resolved
Merged, thanks for your work! |
OMG. @ebyhr merged it! We have an Oracle connector. Thanks, this was desperately needed. |
oracle plugin connector
oracle has release on Maven Central the Oracle JDBC drivers
https://repo1.maven.org/maven2/com/oracle/ojdbc/ojdbc8/19.3.0.0/ojdbc8-19.3.0.0.pom
Fixes #934