Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@olavloite
Copy link

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().

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

codecov bot commented Jul 24, 2019

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 Files Coverage Δ Complexity Δ
...gle/cloud/pubsub/v1/SequentialExecutorService.java 90.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
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
Author

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 kolea2 July 24, 2019 20:19
@olavloite olavloite merged commit ce4b282 into googleapis:spanner-jdbc Jul 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants