feat: adds Exception handling to handle ALREADY EXISTS error#2788
Merged
feat: adds Exception handling to handle ALREADY EXISTS error#2788
Conversation
Contributor
Author
|
@shollyman PTAL |
shollyman
approved these changes
Jul 20, 2023
Contributor
shollyman
left a comment
There was a problem hiding this comment.
left some minor feedback, but generally the pattern looks good
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Show resolved
Hide resolved
google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java
Outdated
Show resolved
Hide resolved
google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
Outdated
Show resolved
Hide resolved
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Jul 25, 2023
🤖 I have created a release *beep* *boop* --- ## [2.31.0](https://togithub.com/googleapis/java-bigquery/compare/v2.30.1...v2.31.0) (2023-07-25) ### Features * Adds Exception handling to handle ALREADY EXISTS error ([#2788](https://togithub.com/googleapis/java-bigquery/issues/2788)) ([67a07ea](https://togithub.com/googleapis/java-bigquery/commit/67a07ea45c4635a2e9d43220d4bc34780eb512ef)) ### Dependencies * Update arrow.version to v12.0.1 ([#2750](https://togithub.com/googleapis/java-bigquery/issues/2750)) ([f92bee5](https://togithub.com/googleapis/java-bigquery/commit/f92bee558f6de070fb9f525bb47a824dc2c53e07)) * Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.24.0 ([#2811](https://togithub.com/googleapis/java-bigquery/issues/2811)) ([b660063](https://togithub.com/googleapis/java-bigquery/commit/b6600635e01f930fa19769cb2594ef4f43226124)) * Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.28.0 ([#2812](https://togithub.com/googleapis/java-bigquery/issues/2812)) ([921716d](https://togithub.com/googleapis/java-bigquery/commit/921716d54ea34f1914d16f7774124175be488087)) * Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.13.1 ([#2806](https://togithub.com/googleapis/java-bigquery/issues/2806)) ([df3cd76](https://togithub.com/googleapis/java-bigquery/commit/df3cd761b5111bb0f174f691765697aa1bcbebde)) * Update dependency org.junit.vintage:junit-vintage-engine to v5.10.0 ([#2808](https://togithub.com/googleapis/java-bigquery/issues/2808)) ([694f711](https://togithub.com/googleapis/java-bigquery/commit/694f7111d7497126d429c5dda17f44f661279582)) * Update github/codeql-action action to v2.21.0 ([#2803](https://togithub.com/googleapis/java-bigquery/issues/2803)) ([c6c536c](https://togithub.com/googleapis/java-bigquery/commit/c6c536c618908425f288fa0e6f516df2cc6a4b97)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
This was referenced Aug 1, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Current Behaviour:
When an explicit Job ID is passed with the query method like this
bigquery.query(config, jobId);, the library throws anALREADY EXISTSerror, if the job already exists. This could happen due to any number of reasons, including retrying the query after the job has been created in the initial run.see go/bq-java-jobid-exists for more context.
Updated Behaviour:
If the following conditions are met, the
ALREADY EXISTSerror is not thrown for a duplicate job. Instead the queryResult of the corresponding job is fetched and returned.