Skip to content

Commit 6a5ab01

Browse files
committed
fix(bigquery): fallback to JSON TableResult when serialized Arrow schema is missing
1 parent 6cc6b6d commit 6a5ab01

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
@@ -2535,20 +2535,13 @@ && getOptions().getOpenTelemetryTracer() != null) {
25352535
return getJob(jobId, options);
25362536
}
25372537

2538-
// If query is complete but Arrow schema is missing, fallback to standard JSON TableResult.
2539-
if (results.getArrowSchema() == null) {
2538+
// If query is complete but Arrow schema is missing or invalid, fallback to standard JSON
2539+
// TableResult if JSON schema is present, or throw an exception.
2540+
if (results.getArrowSchema() == null
2541+
|| results.getArrowSchema().getSerializedSchema() == null) {
25402542
if (results.getSchema() != null) {
25412543
return createTableResultFromJsonResponse(results, options);
25422544
}
2543-
if (results.getJobReference() == null) {
2544-
throw new BigQueryException(
2545-
0, "Arrow schema is missing, but no job reference was returned to fetch results.");
2546-
}
2547-
JobId jobId = JobId.fromPb(results.getJobReference());
2548-
return getJob(jobId, options);
2549-
}
2550-
2551-
if (results.getArrowSchema().getSerializedSchema() == null) {
25522545
throw new BigQueryException(0, "Arrow schema is missing from the response");
25532546
}
25542547

0 commit comments

Comments
 (0)