Skip to content

Commit 88c9eb9

Browse files
committed
fix(bigquery): fallback to JSON TableResult when serialized Arrow schema is missing
1 parent a72b8ea commit 88c9eb9

1 file changed

Lines changed: 4 additions & 11 deletions

File tree

  • java-bigquery/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,20 +2507,13 @@ && getOptions().getOpenTelemetryTracer() != null) {
25072507
return getJob(jobId, options);
25082508
}
25092509

2510-
// If query is complete but Arrow schema is missing, fallback to standard JSON TableResult.
2511-
if (results.getArrowSchema() == null) {
2510+
// If query is complete but Arrow schema is missing or invalid, fallback to standard JSON
2511+
// TableResult if JSON schema is present, or throw an exception.
2512+
if (results.getArrowSchema() == null
2513+
|| results.getArrowSchema().getSerializedSchema() == null) {
25122514
if (results.getSchema() != null) {
25132515
return createTableResultFromJsonResponse(results, options);
25142516
}
2515-
if (results.getJobReference() == null) {
2516-
throw new BigQueryException(
2517-
0, "Arrow schema is missing, but no job reference was returned to fetch results.");
2518-
}
2519-
JobId jobId = JobId.fromPb(results.getJobReference());
2520-
return getJob(jobId, options);
2521-
}
2522-
2523-
if (results.getArrowSchema().getSerializedSchema() == null) {
25242517
throw new BigQueryException(0, "Arrow schema is missing from the response");
25252518
}
25262519

0 commit comments

Comments
 (0)