Skip to content

spanner-jdbc: Step 07 - DirectExecuteResultSet - #5815

Merged
olavloite merged 2 commits into
googleapis:spanner-jdbcfrom
olavloite:spanner-jdbc-07-direct-execute-res-set
Jul 25, 2019
Merged

spanner-jdbc: Step 07 - DirectExecuteResultSet#5815
olavloite merged 2 commits into
googleapis:spanner-jdbcfrom
olavloite:spanner-jdbc-07-direct-execute-res-set

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

The default Cloud Spanner ResultSet implementation defers the execution of a query to the first call to ResultSet#next(). The JDBC Driver requires that queries are executed directly when a statement is passed to the driver, and that any query errors are returned directly. The DirectExecuteResultSet is a wrapper around a normal result set that ensures that the query is executed directly, and that any query errors are propagated directly when the result set is created, instead of deferring this until the first call to ResultSet#next().

@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 24, 2019
@codecov

codecovBot commented Jul 24, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5815 into spanner-jdbc will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@## spanner-jdbc #5815 +/- ##
==================================================
+ Coverage 46.12% 46.12% +<.01% 
Complexity 24189 24189 ==================================================
Files 2456 2456 Lines 262236 262236 Branches 29602 29602 ==================================================
+ Hits 120949 120952 +3 + Misses 132175 132173 -2 + Partials 9112 9111 -1
Impacted FilesCoverage ΔComplexity Δ
...gle/cloud/pubsub/v1/SequentialExecutorService.java90.8% <0%> (+3.44%)0% <0%> (ø)⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae46c78...baa8eeb. Read the comment docs.

try {
if (method.getParameterTypes().length == 0) {
method.invoke(subject);
} else if (method.getParameterTypes().length == 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor - for readability, can we extract some of these out into descriptive variables?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of parameters and parameter type have been extracted to variables and the if-statement has been partially re-written as a switch statement.

@olavloite
olavloite requested a review from kolea2July 24, 2019 20:19
@olavloite
olavloite merged commit ce4b282 into googleapis:spanner-jdbcJul 25, 2019
olavloite added a commit to olavloite/google-cloud-java that referenced this pull request Aug 5, 2019
* add DirectExecuteResultSet
* readability: extracted numberOfParameters and firstParameterType to vars
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@olavloite@kolea2@googlebot