Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Jul 17, 2023
1 parent 054f6f3 commit 8d2005b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -426,16 +426,15 @@ public com.google.api.services.bigquery.model.Job call() {
}

if (!idRandom) {
if (createException instanceof BigQueryException &&
createException.getCause() != null ) {
if (createException instanceof BigQueryException && createException.getCause() != null) {

/*GoogleJsonResponseException createExceptionCause =
(GoogleJsonResponseException) createException.getCause();*/
(GoogleJsonResponseException) createException.getCause();*/

Pattern pattern = Pattern.compile(".*Already.*Exists:.*Job.*", Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(createException.getCause().getMessage());

if (matcher.find() ) {
if (matcher.find()) {
// If the Job ALREADY EXISTS, retrieve it.
Job job = this.getJob(jobInfo.getJobId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6080,7 +6080,11 @@ public void testForeignKeysUpdate() {

@Test
public void testAlreadyExistJobExceptionHandling() throws InterruptedException {
String query = "SELECT TimestampField, StringField, BooleanField FROM " +DATASET + "."+ TABLE_ID.getTable();
String query =
"SELECT TimestampField, StringField, BooleanField FROM "
+ DATASET
+ "."
+ TABLE_ID.getTable();
JobId jobId = JobId.newBuilder().setRandomJob().build();

JobConfiguration queryJobConfiguration = QueryJobConfiguration.newBuilder(query).build();
Expand Down

0 comments on commit 8d2005b

Please sign in to comment.