public class QueryResponse extends Object implements Serializable
BigQuery.getQueryResults(JobId, BigQuery.QueryResultsOption...)) or of a
Query Request (BigQuery.query(QueryRequest)).
Example usage of a query response:
QueryResponse response = bigquery.query(request);
while (!response.jobCompleted()) {
Thread.sleep(1000);
response = bigquery.getQueryResults(response.jobId());
}
List<BigQueryError> executionErrors = response.executionErrors();
// look for errors in executionErrors
QueryResult result = response.result();
Iterator<List<FieldValue>> rowIterator = result.iterateAll();
while(rowIterator.hasNext()) {
List<FieldValue> row = rowIterator.next();
// do something with row
}
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
etag()
Returns the hash of the
QueryResponse resource or null if not set. |
List<BigQueryError> |
executionErrors()
Returns errors and warnings encountered during the running of the job, if any.
|
boolean |
hasErrors()
Returns whether errors and warnings occurred during the execution of the job.
|
int |
hashCode() |
boolean |
jobCompleted()
Returns whether the job running the query has completed or not.
|
JobId |
jobId()
Returns the identity of the BigQuery Job that was created to run the query.
|
QueryResult |
result()
Returns the result of the query.
|
String |
toString() |
public QueryResult result()
public String etag()
QueryResponse resource or null if not set.public JobId jobId()
public boolean jobCompleted()
public boolean hasErrors()
true it does not necessarily mean that the job has completed or was
unsuccessful.public List<BigQueryError> executionErrors()
Copyright © 2016 Google. All rights reserved.