Skip to content

Commit ee3e7d0

Browse files
committed
Update Job creation mode if not explicitly set
1 parent a973a8d commit ee3e7d0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryImpl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.google.cloud.Tuple;
4141
import com.google.cloud.bigquery.BigQueryRetryHelper.BigQueryRetryHelperException;
4242
import com.google.cloud.bigquery.InsertAllRequest.RowToInsert;
43+
import com.google.cloud.bigquery.QueryJobConfiguration.JobCreationMode;
4344
import com.google.cloud.bigquery.spi.v2.BigQueryRpc;
4445
import com.google.cloud.bigquery.spi.v2.HttpBigQueryRpc;
4546
import com.google.common.annotations.VisibleForTesting;
@@ -2045,6 +2046,14 @@ public Object queryWithTimeout(
20452046
throws InterruptedException, JobException {
20462047
Job.checkNotDryRun(configuration, "query");
20472048

2049+
// If JobCreationMode is not explicitly set, update it with default value;
2050+
if (configuration.getJobCreationMode() == null){
2051+
configuration =
2052+
configuration.toBuilder()
2053+
.setJobCreationMode(getOptions().getDefaultJobCreationMode())
2054+
.build();
2055+
}
2056+
20482057
Span querySpan = null;
20492058
if (getOptions().isOpenTelemetryTracingEnabled()
20502059
&& getOptions().getOpenTelemetryTracer() != null) {

0 commit comments

Comments
 (0)