Skip to content
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7889,7 +7889,17 @@ public void testOpenTelemetryTracingQuery() throws InterruptedException {
bigquery.getOptions().setDefaultJobCreationMode(JobCreationMode.JOB_CREATION_OPTIONAL);
TableResult tableResult = executeSimpleQuery(bigquery);
assertNotNull(tableResult.getQueryId());
assertNull(tableResult.getJobId());

// Safely handle the fallback where BigQuery determines a job must be created
// even if the mode is optional. Most requests will be stateless, but it is still
// possible that the BQ engine will create a job even for tiny requests.
if (tableResult.getJobCreationReason() != null) {
assertNotNull(tableResult.getJobId());
assertEquals(tableResult.getQueryId(), tableResult.getJobId().getJob());
assertEquals(JobCreationReason.Code.OTHER, tableResult.getJobCreationReason().getCode());
} else {
assertNull(tableResult.getJobId());
}

assertNotNull(OTEL_ATTRIBUTES.get("com.google.cloud.bigquery.BigQuery.queryRpc"));
assertNotNull(
Expand Down
Loading