feat: Oracle connector enhancements#25355
feat: Oracle connector enhancements#25355Dilli-Babu-Godari wants to merge 5 commits intoprestodb:masterfrom
Conversation
0e2d96e to
cf1e277
Compare
|
Thanks for the release note entry!
|
|
@ethanyzhang imported this issue as lakehouse/presto #25355 |
There was a problem hiding this comment.
I have a few comments -
- Let's split PR in 2 commits - TLS & fetchsize changes
- I think TLS is going to be a generic feature acorss different JDBC connectors, maybe we can create a separate TLS config or have it in BaseJDBC config and reuse it in the required JDBC connector?
presto-oracle/src/main/java/com/facebook/presto/plugin/oracle/OracleConfig.java
Outdated
Show resolved
Hide resolved
presto-oracle/src/main/java/com/facebook/presto/plugin/oracle/OracleConfig.java
Outdated
Show resolved
Hide resolved
This PR currently includes 4 combined PR changes. I can split them into 2 separate commits as you suggested. |
4830ea8 to
e15a068
Compare
Updated the changes |
c378b25 to
6de476f
Compare
Thanks for addressing the last point! Please address these:
|
Updated the changes. |
564d0ea to
beaac68
Compare
|
Assigning this issue to @faizdani because you are the default assignee for issue follow-up scheme |
|
@faizdani |
8d8e7df to
c6ad416
Compare
|
This PR depends on the test-enabling PR: #25762 for adding tests. |
|
Assigning this issue to @faizdani because you are the default assignee for issue follow-up scheme |
|
@faizdani |
0334241 to
676b9fd
Compare
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 1968770...5310db8. No notifications. |
agrawalreetika
left a comment
There was a problem hiding this comment.
Thanks for the PR.
Please add documentation for all the newly added properties.
| { | ||
| this.fetchSize = fetchSize; | ||
| return this; | ||
| } |
There was a problem hiding this comment.
Is this applicable for other JDBC connectors as well? If yes, then we need to make usagae of it in other connectors as well
There was a problem hiding this comment.
Yes, the jdbc-fetch-size configuration in BaseJdbcConfig is designed to be applicable across all JDBC connectors. We should make the changes in connectors that support.
There was a problem hiding this comment.
Then it would be good to either open a follow up PR or an issue
There was a problem hiding this comment.
Yes, I’ll create an issue to track this and follow up with a PR.
There was a problem hiding this comment.
Can you link the issue to this, if you have it?
presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/BaseJdbcConfig.java
Show resolved
Hide resolved
| escapeNamePattern(schemaName, Optional.of(escape)).orElse(null), | ||
| escapeNamePattern(tableName, Optional.of(escape)).orElse(null), | ||
| getTableTypes()); | ||
| resultSet.setFetchSize(fetchSize); |
There was a problem hiding this comment.
This doesn't look correct - setFetchSize() is called on the ResultSet after metadata.getTables() has already executed.
I see OracleConnection has setDefaultRowPrefetch, so it should be set in the OracleConnection https://github.com/mikesmithjr/ora-jdbc-source/blob/master/OracleJDBC/src/oracle/jdbc/OracleConnection.java#L97
There was a problem hiding this comment.
Thanks for pointing this out.
Updated the implementation to unwrap OracleConnection and set setDefaultRowPrefetch(fetchSize) before query execution. Applied this consistently in both getTables() and getPreparedStatement().
There was a problem hiding this comment.
Can you help me understand how it is setting it in getTables() and getPreparedStatement(), the same as setting it in ConnectionFactory so it can be applied across all the operatoins?
There was a problem hiding this comment.
Oracle connector currently uses the default DriverConnectionFactory, so introducing a connection-level setting would require adding a custom factory.
Since this optimization is primarily relevant for specific operations like getTables() and prepared statements, scoped it at the method level, where large result set fetching is expected.
This avoids introducing connector-wide behavior changes while keeping the optimization targeted. That said, we can move this to a custom OracleConnectionFactory if we want it to apply uniformly across all operations.
There was a problem hiding this comment.
In my opinion, it would be better to keep the fetch consistent across since it's an Oracle batch fetch-related config. Open to hear suggestions as well
There was a problem hiding this comment.
I will introduce a custom OracleConnectionFactory for the batch fetch-related config instead of doing it in the connectonFactory in OracleClientModule.java
what do you think of this ?
presto-oracle/src/main/java/com/facebook/presto/plugin/oracle/OracleConfig.java
Show resolved
Hide resolved
presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/BaseJdbcConfig.java
Show resolved
Hide resolved
There was a problem hiding this comment.
A local doc build returns the following error:
/Users/steveburnett/Documents/GitHub/presto/presto-docs/src/main/sphinx/connector/oracle.rst:56: ERROR: Malformed table. Bottom/header table border does not match top border.
The entire table in General Configuration Properties is not displayed as a result. See screenshot of my local doc build.
Please fix the formatting of the table and re-request my review, and I'll be happy to review the content.
|
Assigning this issue to @faizdani because you are the default assignee for issue follow-up scheme |
|
@faizdani |
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull updated branch, new local doc build, looks good. Thanks!
Oracle connector fails with a connection timeout, while show tables, when the schema has a 1 lakh tables. This happens because we are not specifying the fetch_size with the getTables method in Oracle. As a result, the connector uses the default fetch_size, which is a smaller value (10), leading to multiple network calls to the datasource and ultimately causing a connection timeout., Co-authored-by: lukmanulhakkeem <lukmanul.hakkeem.a@ibm.com> # Conflicts: # presto-oracle/src/main/java/com/facebook/presto/plugin/oracle/OracleClient.java
added the orai18n.jar dependency, ensuring compatibility with non-UTF character sets like WE8ISO8859P9.
SSL enablement of Oracle Connector with Oracle THIN JDBC driver Co-authored-by: lukmanulhakkeem <lukmanul.hakkeem.a@ibm.com>
agrawalreetika
left a comment
There was a problem hiding this comment.
Mostly lgtm apart from few comments.
| { | ||
| this.fetchSize = fetchSize; | ||
| return this; | ||
| } |
There was a problem hiding this comment.
Can you link the issue to this, if you have it?
| connectionProperties.setProperty("javax.net.ssl.trustStorePassword", oracleConfig.getTruststorePassword()); | ||
| } | ||
| } | ||
| connectionProperties.setProperty(OracleConnection.CONNECTION_PROPERTY_INCLUDE_SYNONYMS, String.valueOf(oracleConfig.isSynonymsEnabled())); |
| if (oracleConfig.isTlsEnabled()) { | ||
| if (oracleConfig.getTrustStorePath() != null) { | ||
| connectionProperties.setProperty("javax.net.ssl.trustStore", oracleConfig.getTrustStorePath()); | ||
| } | ||
| if (oracleConfig.getTruststorePassword() != null) { | ||
| connectionProperties.setProperty("javax.net.ssl.trustStorePassword", oracleConfig.getTruststorePassword()); | ||
| } | ||
| } |
There was a problem hiding this comment.
| if (oracleConfig.isTlsEnabled()) { | |
| if (oracleConfig.getTrustStorePath() != null) { | |
| connectionProperties.setProperty("javax.net.ssl.trustStore", oracleConfig.getTrustStorePath()); | |
| } | |
| if (oracleConfig.getTruststorePassword() != null) { | |
| connectionProperties.setProperty("javax.net.ssl.trustStorePassword", oracleConfig.getTruststorePassword()); | |
| } | |
| } | |
| if (oracleConfig.isTlsEnabled()) { | |
| requireNonNull(oracleConfig.getTrustStorePath(), "oracle.tls.truststore-path is null"); | |
| connectionProperties.setProperty("javax.net.ssl.trustStore", oracleConfig.getTrustStorePath()); | |
| connectionProperties.setProperty("javax.net.ssl.trustStorePassword", oracleConfig.getTruststorePassword()); | |
| } |
We can simplify this. Since the truststore password can be null for self-signed certs, null checks may not be needed for this.

Description
Oracle connector enhancements.
Motivation and Context
Impact
Test Plan
Testing for fetch_size:
Presto-CLI:
jdbc-fetch-size = 10
20260407_144910_00006_m2vrb_small_fetch.json
jdbc-fetch-size = 1000
20260407_144746_00005_m2vrb_large_fetch.json
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.