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.getJobId());
}
List<BigQueryError> executionErrors = response.getExecutionErrors();
// look for errors in executionErrors
QueryResult result = response.getResult();
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()
Deprecated.
|
List<BigQueryError> |
executionErrors()
Deprecated.
|
String |
getEtag()
Returns the hash of the
QueryResponse resource or null if not set. |
List<BigQueryError> |
getExecutionErrors()
Returns errors and warnings encountered during the running of the job, if any.
|
JobId |
getJobId()
Returns the identity of the BigQuery Job that was created to run the query.
|
QueryResult |
getResult()
Returns the result of the query.
|
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()
Deprecated.
|
QueryResult |
result()
Deprecated.
|
String |
toString() |
@Deprecated public QueryResult result()
public QueryResult getResult()
@Deprecated public String etag()
QueryResponse
resource or null
if not set.public String getEtag()
QueryResponse
resource or null
if not set.@Deprecated public JobId jobId()
public JobId getJobId()
public boolean jobCompleted()
public boolean hasErrors()
true
it does not necessarily mean that the job has completed or was
unsuccessful.@Deprecated public List<BigQueryError> executionErrors()
public List<BigQueryError> getExecutionErrors()
Copyright © 2016 Google. All rights reserved.