Skip to content
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: adds Exception handling to handle ALREADY EXISTS error #2788

Merged
merged 12 commits into from Jul 24, 2023

Conversation

Neenu1995
Copy link
Contributor

@Neenu1995 Neenu1995 commented Jul 14, 2023

Current Behaviour:
When an explicit Job ID is passed with the query method like this
bigquery.query(config, jobId);, the library throws an ALREADY EXISTS error, 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 EXISTS error is not thrown for a duplicate job. Instead the queryResult of the corresponding job is fetched and returned.

  1. An explicit job ID job ID has been provided.
  2. The job is not older than 24 hours.

@Neenu1995 Neenu1995 requested a review from a team as a code owner July 14, 2023 18:19
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/java-bigquery API. labels Jul 14, 2023
@Neenu1995 Neenu1995 changed the title feat: adds Exception handling to handle ALREADy EXISTS error feat: adds Exception handling to handle ALREADY EXISTS error Jul 14, 2023
@Neenu1995 Neenu1995 added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Jul 14, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 14, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 14, 2023
@gcf-owl-bot gcf-owl-bot bot requested a review from a team as a code owner July 17, 2023 18:46
@Neenu1995 Neenu1995 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2023
@Neenu1995 Neenu1995 added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Jul 17, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 17, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 17, 2023
@Neenu1995 Neenu1995 requested a review from shollyman July 17, 2023 20:42
@Neenu1995
Copy link
Contributor Author

@shollyman PTAL

Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

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

left some minor feedback, but generally the pattern looks good

@Neenu1995 Neenu1995 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2023
@Neenu1995 Neenu1995 added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 21, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 21, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 21, 2023
@Neenu1995 Neenu1995 merged commit 67a07ea into main Jul 24, 2023
16 checks passed
@Neenu1995 Neenu1995 deleted the retry-logic branch July 24, 2023 15:24
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants