Skip to content
This repository was archived by the owner on Mar 23, 2026. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix style
  • Loading branch information
whuffman36 committed Jun 4, 2025
commit ca349693cda74b071a04654e9d671ee2704a2f88
Original file line number Diff line number Diff line change
Expand Up @@ -496,24 +496,24 @@ public com.google.api.services.bigquery.model.Job call() throws IOException {
createException = e;
}

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

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

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

long jobCreationTime = job.getStatistics().getCreationTime();
long jobMinStaleTime = System.currentTimeMillis();
long jobMaxStaleTime =
java.time.Instant.ofEpochMilli(jobMinStaleTime)
.minus(1, java.time.temporal.ChronoUnit.DAYS)
.toEpochMilli();
if (!idRandom) {
if (createException instanceof BigQueryException
&& createException.getCause() != null
&& createException.getCause().getMessage() != null) {

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

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

long jobCreationTime = job.getStatistics().getCreationTime();
long jobMinStaleTime = System.currentTimeMillis();
long jobMaxStaleTime =
java.time.Instant.ofEpochMilli(jobMinStaleTime)
.minus(1, java.time.temporal.ChronoUnit.DAYS)
.toEpochMilli();

// Only return the job if it has been created in the past 24 hours.
// This is assuming any job older than 24 hours is a valid duplicate JobID
Expand Down