Closed polleyg closed 7 years ago
Any news? This is a kind of blocking situazion when using API.
This is not a bug, but rather confusing documentation/examples. See updated SO question - http://stackoverflow.com/questions/42099842/bigquery-how-to-iterate-over-results-using-java-api
Closing out - see the Stack Overflow question.
This is in relation to post on Stack Overflow post here.
As per the sample code here, a user should be be able to paginate the results of a BigQuery query using the following code structure:
However, when the result set is large (in my tests >31,000 rows), more rows are returned/iterated even though calling
result.getTotalRows()
returns the correct/expected number of rows.For example, I have a table with 85,250 rows (9.45 MB). When I query it via the Java API, and use the code from the example above, it actually iterates 160,296 times.
Even if I limit the result set in the query using
limit 5000
, and setsetPageSize(1000L)
, then it iterates 15,000 times e.g:Output: