fix(bigquery): prevent NullPointerException in OTel tracing when JobId is null by keshavdandeva · Pull Request #13301 · googleapis/google-cloud-java (original) (raw)

b/517929704

This PR addresses a NullPointerException that occurs in the BigQuery client library when OpenTelemetry tracing is enabled and operations are performed on jobs that do not have a client-assigned JobId at the start of the call.

A notable case where this happens is during dry-run queries (often used to determine statement type or fetch statistics) where JobInfo.getJobId() returns null. The OTel instrumentation was attempting to extract attributes from the JobId without checking for nullability.

Changes: