Skip to content

Update QueryPagination.java code to better match the comments #1207

Closed
@ShyamShah11

Description

@ShyamShah11

Thanks for stopping by to let us know something could be better!

Is your feature request related to a problem? Please describe.
With regards to the query pagination example, the current code makes it seem like lines 60-63 would only print the first 20 rows, but it actually prints all of the results since .iterateAll() fetches the next page automatically upon exhausting elements on the given page (mentioned in the docs).

Describe the solution you'd like
We can replace .iterateAll() with .getValues() to only get the results of a single page instead. I've put a PR together with these changes.

Describe alternatives you've considered
I tried to use the results of a query job instead of writing to a table and then using the listTableData method but the results are the same since .iterateAll() does the same thing.

Additional context
This caused some confusion for a GCP customer on a support case and I've opened a ticket internally for some other public documentation changes.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the googleapis/java-bigquery API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions