BigQuery JDBC驱动程序不会返回超过100,000行 [英] BigQuery JDBC driver won't return more than 100,000 rows
问题描述
我在Pentaho PDI中为Google BigQuery使用starschema JDBC驱动程序:
http://code.google.com/p/starschema-bigquery-jdbc/
我的通过BigQuery Web Console查询返回129,993行,但是当我通过JDBC驱动程序执行相同的查询时,它只返回100,000行。是否有某种选项或限制,我不知道?
StarSchema代码看起来像只返回第一页结果。
这里的代码这里应该被更新以获得其余的结果。它应该看起来像这样:
public static GetQueryResultsResponse getQueryResults(Bigquery bigquery,
String projectId,Job completedJob)throws IOException {
GetQueryResultsResponse queryResult = bigquery.jobs()
.getQueryResults(projectId,
completedJob.getJobReference()。getJobId())。execute(); ()queryResult.getRows()。size()){
queryResult.getRows()。addAll(
bigquery.jobs()
) getQueryResults(projectId,
completedJob.getJobReference()。getJobId())
.setStartIndex(queryResult.getRows()。size())
.execute()
.getRows ));
}
返回queryResult;
}
I am using the starschema JDBC driver for Google BigQuery in Pentaho PDI:
http://code.google.com/p/starschema-bigquery-jdbc/
My query through the BigQuery Web Console returns 129,993 rows, but when I execute the same query through the JDBC driver it only returns 100,000 rows. Is there some kind of option or limit that I am not aware of?
The StarSchema code looks like it is only returning the first page of results.
The code here here should be updated to get the rest of the results. It should look something like:
public static GetQueryResultsResponse getQueryResults(Bigquery bigquery,
String projectId, Job completedJob) throws IOException {
GetQueryResultsResponse queryResult = bigquery.jobs()
.getQueryResults(projectId,
completedJob.getJobReference().getJobId()).execute();
while(queryResult.getTotalRows() > queryResult.getRows().size()) {
queryResult.getRows().addAll(
bigquery.jobs()
.getQueryResults(projectId,
completedJob.getJobReference().getJobId())
.setStartIndex(queryResult.getRows().size())
.execute()
.getRows());
}
return queryResult;
}
这篇关于BigQuery JDBC驱动程序不会返回超过100,000行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!