use of com.google.api.services.bigquery.Bigquery.Jobs.GetQueryResults in project zeppelin by apache.
the class BigQueryInterpreter method run.
//Function to run the SQL on bigQuery service
public static Iterator<GetQueryResultsResponse> run(final String queryString, final String projId, final long wTime, final long maxRows) throws IOException {
try {
QueryResponse query = service.jobs().query(projId, new QueryRequest().setTimeoutMs(wTime).setQuery(queryString).setMaxResults(maxRows)).execute();
jobId = query.getJobReference().getJobId();
projectId = query.getJobReference().getProjectId();
GetQueryResults getRequest = service.jobs().getQueryResults(projectId, jobId);
return getPages(getRequest);
} catch (IOException ex) {
throw ex;
}
}
Aggregations