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: Add executeSelectAsync and Refactor #2294
Merged
prash-mi
merged 27 commits into
googleapis:main
from
prash-mi:async-execute-select-and-refactor
Oct 12, 2022
Merged
Changes from 15 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1591411
Add executeSelectAsync
prash-mi 6e83662
Add executeSelectAsync
prash-mi 6ea69d5
Add ExecuteSelectResponse
prash-mi 344d34b
Add executeSelectAsync(...) methods
prash-mi 3133ca9
feat: Add executeSelectAsync
prash-mi 3350360
implemented ExecuteSelectResponse Builder
prash-mi 0bee0d3
Refactored executeSelect. Added getExecuteSelectResponse
prash-mi 149242c
marked getExecuteSelectFuture private
prash-mi 24c16fe
marked getExecuteSelectFuture private
prash-mi a16eb33
Add UT for Async methods
prash-mi 6c1b6ed
Added IT for async methods
prash-mi 031e81a
Removed testFastQueryNullSchema as it is no longer needed
prash-mi 1dda219
removed dryRun calls as now we wait till the job is complete
prash-mi a420b4e
Added testExecuteSelectAsyncTimeout
prash-mi 81798f4
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] e54dba9
updated getExecuteSelectFuture
prash-mi b99935b
Merge remote-tracking branch 'origin/async-execute-select-and-refacto…
prash-mi 2c0471d
lint
prash-mi f54136d
Add getters and setters for BigQuerySQLException
prash-mi 89dc083
Add javadoc for overloaded executeSelectAsync and refactored getExecu…
prash-mi ffa218a
Marked ResultSet and BQSQLException optional
prash-mi 89b29b9
minor refactor: getExecuteSelectFuture
prash-mi 896b476
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] 53029f1
Merge branch 'master' into async-execute-select-and-refactor
prash-mi 429101b
Merge remote-tracking branch 'origin/async-execute-select-and-refacto…
prash-mi 704ec9d
update getExecuteSelectFuture
prash-mi cba789e
update javadoc
prash-mi File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/ExecuteSelectResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.bigquery; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import java.io.Serializable; | ||
|
||
@AutoValue | ||
public abstract class ExecuteSelectResponse implements Serializable { | ||
public abstract BigQueryResult getResultSet(); | ||
|
||
public abstract boolean getIsSuccessful(); | ||
|
||
public static Builder newBuilder() { | ||
return new AutoValue_ExecuteSelectResponse.Builder(); | ||
} | ||
|
||
@AutoValue.Builder | ||
public abstract static class Builder { | ||
public abstract ExecuteSelectResponse build(); | ||
|
||
public abstract Builder setResultSet(BigQueryResult bigQueryResult); | ||
|
||
public abstract Builder setIsSuccessful(boolean isSuccessful); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is there value in doing this check? does executeSelect not properly deal with null params?
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 pointing this our @shollyman ,
null
check isn't required here as the underlying method deals with it. Replaced it with a call toexecuteSelect( sql, parameters, labels)
. Also added exception handling to pass back any exception which might have occurred.