Skip to content

Commit

Permalink
fixed testExecuteQuerySinglePageTableRow
Browse files Browse the repository at this point in the history
  • Loading branch information
prash-mi committed Sep 29, 2021
1 parent c7da28f commit ac16aec
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1958,17 +1958,21 @@ public void testQueryExternalHivePartitioningOptionCustomLayout() throws Interru

@Test
public void testExecuteQuerySinglePageTableRow() throws SQLException {
String query = "SELECT * FROM " + TABLE_ID_FASTQUERY.getTable();
String query =
"SELECT TimestampField, StringField, BooleanField FROM " + TABLE_ID_FASTQUERY.getTable();
ConnectionSettings connectionSettings =
ConnectionSettings.newBuilder().setDefaultDataset(DatasetId.of(DATASET)).build();
Connection connection = bigquery.createConnection(connectionSettings);
BigQueryResultSet bigQueryResultSet = connection.executeSelect(query);
ResultSet rs = bigQueryResultSet.getResultSet();
while (rs.next()) {
// System.out.println(rs.getString("TimestampField"));
}
// assertEquals(QUERY_RESULT_SCHEMA, bigQueryResultSet.getSchema());
// assertEquals(2, bigQueryResultSet.getTotalRows());
// while (rs.next()) {
// System.out.println(rs.getString("TimestampField"));
// }
assertEquals(QUERY_RESULT_SCHEMA, bigQueryResultSet.getSchema());
assertEquals(2, bigQueryResultSet.getTotalRows());
assertTrue(rs.next());
assertTrue(rs.next());
assertFalse(rs.next()); // it should return false for the third call as the table has 2 rows
}

@Test
Expand Down

0 comments on commit ac16aec

Please sign in to comment.