Skip to content

Commit

Permalink
docs(samples): update querypagination sample (#2074)
Browse files Browse the repository at this point in the history
- Updated example to loop through all remaining pages

Changes for the open issue: #2073
  • Loading branch information
AyushWalekar committed May 26, 2022
1 parent 621d357 commit 4e153f5
Showing 1 changed file with 3 additions and 11 deletions.
Expand Up @@ -62,19 +62,11 @@ public static void queryPagination(String datasetName, String tableName, String
.getValues()
.forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString())));

if (results.hasNextPage()) {
// Next Page
results
.getNextPage()
.getValues()
.forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString())));
}

if (results.hasNextPage()) {
while (results.hasNextPage()) {
// Remaining Pages
results = results.getNextPage();
results
.getNextPage()
.iterateAll()
.getValues()
.forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString())));
}

Expand Down

0 comments on commit 4e153f5

Please sign in to comment.