Skip to content

Commit

Permalink
docs(samples): update querypagination sample (#1209)
Browse files Browse the repository at this point in the history
Based on feedback from a support case, I've made some changes to make this more clear and more accurate to what the comments indicate

Created #1207 to track this

Fixes #1207 ☕️
  • Loading branch information
ShyamShah11 committed Mar 31, 2021
1 parent 2918a5b commit 9b4f3ec
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -59,15 +59,23 @@ public static void queryPagination(String datasetName, String tableName, String

// First Page
results
.iterateAll()
.forEach(row -> row.forEach(val -> System.out.printf("%s,", val.toString())));
.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()) {
// Remaining Pages
results
.getNextPage()
.iterateAll()
.forEach(row -> row.forEach(val -> System.out.printf("%s,", val.toString())));
.forEach(row -> row.forEach(val -> System.out.printf("%s,\n", val.toString())));
}

System.out.println("Query pagination performed successfully.");
Expand Down

0 comments on commit 9b4f3ec

Please sign in to comment.