File tree Expand file tree Collapse file tree
java-bigquery/google-cloud-bigquery/src
main/java/com/google/cloud/bigquery
test/java/com/google/cloud/bigquery Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,12 +100,18 @@ public String getNextPageToken() {
100100 @ Override
101101 public TableResult getNextPage () {
102102 if (getPageNoSchema ().hasNextPage ()) {
103+ Page <FieldValueList > nextPageNoSchema = getPageNoSchema ().getNextPage ();
104+ long nextRows =
105+ nextPageNoSchema .getValues () != null
106+ ? (long ) Iterables .size (nextPageNoSchema .getValues ())
107+ : 0L ;
103108 return TableResult .newBuilder ()
104109 .setSchema (getSchema ())
105110 .setTotalRows (getTotalRows ())
106- .setPageNoSchema (getPageNoSchema (). getNextPage () )
111+ .setPageNoSchema (nextPageNoSchema )
107112 .setQueryId (getQueryId ())
108113 .setJobCreationReason (getJobCreationReason ())
114+ .setRowsInPage (nextRows )
109115 .build ();
110116 }
111117 return null ;
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ void testNullSchema() {
7171 assertThat (next .getSchema ()).isNull ();
7272 assertThat (next .hasNextPage ()).isFalse ();
7373 assertThat (next .getNextPageToken ()).isNull ();
74- assertThat (next .getRowsInPage ()).isNull ( );
74+ assertThat (next .getRowsInPage ()).isEqualTo ( 1L );
7575 assertThat (next .getValues ()).containsExactly (newFieldValueList ("2" ));
7676 assertThat (next .getNextPage ()).isNull ();
7777
@@ -103,7 +103,7 @@ void testSchema() {
103103 assertThat (next .getSchema ()).isEqualTo (SCHEMA );
104104 assertThat (next .hasNextPage ()).isFalse ();
105105 assertThat (next .getNextPageToken ()).isNull ();
106- assertThat (next .getRowsInPage ()).isNull ( );
106+ assertThat (next .getRowsInPage ()).isEqualTo ( 1L );
107107 assertThat (next .getValues ())
108108 .containsExactly (newFieldValueList ("2" ).withSchema (SCHEMA .getFields ()));
109109 assertThat (next .getNextPage ()).isNull ();
You can’t perform that action at this time.
0 commit comments