-
Notifications
You must be signed in to change notification settings - Fork 188
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
Feat: Support for "Update" type queries in Templated Benchmarks #386
Conversation
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.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.
LGTM, make it public and ask Brian for a review.
@bpkroth could you give me a review for this PR? |
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
// False for UPDATE, INSERT, DELETE queries | ||
boolean hasResultSet = stmt.execute(); | ||
|
||
while (true) { |
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.
This is kind of a weird double loop.
There should never be any more results for INSERT/UPDATE/DELETE, correct?
So, you really don't need to outer loop with a break
. Just the if hasResultSet and then loop inside that?
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.
Maybe just add an assert inside the INSERT/UPDATE/DELETE branch that it doesn't have more results and remove the outer loop.
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.
The way I understand it, we can theoretically have a statement with multiple queries (select * from x; select * from y) which would return multiple result sets. And they could theoretically also get mixed with "update" type queries.
The question is whether we want to only support this for "select" type queries, all possible combinations or we do not want to support this at all
I have currently adapted such that only a combination of "select" type queries would be supported
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Show resolved
Hide resolved
minor nits for whitespace change
fix indentation issue
src/main/java/com/oltpbenchmark/benchmarks/templated/procedures/GenericQuery.java
Outdated
Show resolved
Hide resolved
…s/GenericQuery.java nit: whitespace
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.
Fixed some small whitespace issues. LGTM now. Thanks for the contribution!
Feature adds a check for UPDATE style queries and handles the execution in templated benchmarks