Skip to content

Code snippet error - response.getResult returns nullptr if job not completed. #570

Closed
@cobookman

Description

@cobookman

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/bigquery/cloud-client/src/main/java/com/example/bigquery/SimpleApp.java#L53

Did you change the file? If so, how?

while (!response.jobCompleted()) {
  Thread.sleep(1000);
  response = bigquery.getQueryResults(response.getJobId());
}
List<BigQueryError> executionErrors = response.getExecutionErrors();
// look for errors in executionErrors
QueryResult result = response.getResult();

Describe the issue

response.getResult() will return with a nullptr if the job has not completed yet. It does not block until job is completed.

http://googlecloudplatform.github.io/google-cloud-java/0.5.0/apidocs/com/google/cloud/bigquery/QueryResponse.html#getResult()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions