-
Notifications
You must be signed in to change notification settings - Fork 185
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
Oracle db support #379
Oracle db support #379
Conversation
Waiting for approvals before reopening. |
Added Oracle profile as an optional feature. Building and running Oracle profile is similar to other benchmarks. ./mvnw clean package -P oracle Tested with Oracle Database Express Edition 18.4.0, 21.3.0 and Oracle DB Free Release 23.2.0.0. Some changes that need explanations:
GitHub Actions with Oracle DB is also added. Latest run
A remaining issue:
|
@fgauthie @kavorobyov Please review. Should I also include GraalVM Native Image configuration file in this PR as well? |
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 sending this! Please address the comments in the review.
Most importantly please remove the Oracle copyright. We cannot take this.
// CLOB needs to be done while connection is alive | ||
if (dbType == DatabaseType.ORACLE) { | ||
for (Object[] configProfileInstance: configProfile) { | ||
configProfileInstance[3] = SQLUtil.clobToString(configProfileInstance[3]); | ||
} | ||
} |
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.
Can you explain why this is necessary?
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.
Oracle DB DDL contains some CLOB fields (for LoadConfig procedures). These CLOB needs to be converted to String while the connection is alive.
This CLOB conversion for Oracle needs to be done here, otherwise the conversion will be attempted by SQLUtil.getString(Object)
after the connection closes, which will result in java.sql.SQLRecoverableException: Closed Connection
.
private static final Class<?> ORACLE_TIMESTAMP; | ||
private static final Method TIMESTAMP_VALUE_METHOD; | ||
static { | ||
Method timestampValueMethod; | ||
Class<?> oracleTimestamp; | ||
try { | ||
oracleTimestamp = Class.forName("oracle.sql.TIMESTAMP"); | ||
timestampValueMethod = oracleTimestamp.getDeclaredMethod("timestampValue"); | ||
} catch (ClassNotFoundException | NoSuchMethodException e) { | ||
oracleTimestamp = null; | ||
timestampValueMethod = null; | ||
} | ||
TIMESTAMP_VALUE_METHOD = timestampValueMethod; | ||
ORACLE_TIMESTAMP = oracleTimestamp; | ||
} |
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.
What is this code doing? Why is it necessary?
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.
+1, a few more comments would be nice
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.
Oracle support needed TIMESTAMP fields which corresponds to OJDBC-specific type oracle.sql.TIMESTAMP
(not available in JDBC).
I need to convert OJDBC timestamp to JDBC java.sql.Timestamp
(with timestampValue method) without having to import the type directly, hence the use of reflection with Class.forName(String)
and getDeclaredMethod(String)
. For Oracle profile the types will be initialized and used in getTimestamp(Object)
and for other profiles the variables will be null and the conversion branch wouldn't be reachable.
src/main/java/com/oltpbenchmark/benchmarks/auctionmark/AuctionMarkLoader.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/auctionmark/AuctionMarkProfile.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/otmetrics/procedures/GetSessionRange.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/resourcestresser/procedures/CPU1.java
Show resolved
Hide resolved
src/main/resources/benchmarks/chbenchmark/gather_schema_stats_oracle.sql
Outdated
Show resolved
Hide resolved
src/main/resources/benchmarks/tpch/gather_schema_stats_oracle.sql
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/auctionmark/AuctionMarkLoader.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/auctionmark/AuctionMarkLoader.java
Outdated
Show resolved
Hide resolved
Left some cleanup nits and one remaining comment about the docker image selection, but overall this is looking pretty good to me. Thanks for your continued work on it! |
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.
LGTM. @apavlo, any further comments?
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.
LGTM
No description provided.