Skip to content

Commit

Permalink
ARROW-3966: Using a 1:N loop instead of a 0:N-1 loop for fewer index …
Browse files Browse the repository at this point in the history
…offsets in code.
  • Loading branch information
Mike Pigott committed Feb 3, 2019
1 parent cfb2ba6 commit cc6cc88
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@ public static void assertFieldMetadataMatchesResultSetMetadata(ResultSetMetaData
assertEquals(rsmd.getColumnCount(), fields.size());

// Vector columns are created in the same order as ResultSet columns.
for (int i = 0; i < rsmd.getColumnCount(); ++i) {
Map<String, String> metadata = fields.get(i).getMetadata();
for (int i = 1; i <= rsmd.getColumnCount(); ++i) {
Map<String, String> metadata = fields.get(i - 1).getMetadata();

assertNotNull(metadata);
assertEquals(4, metadata.size());

assertEquals(rsmd.getCatalogName(i + 1), metadata.get(Constants.SQL_CATALOG_NAME_KEY));
assertEquals(rsmd.getTableName(i + 1), metadata.get(Constants.SQL_TABLE_NAME_KEY));
assertEquals(rsmd.getColumnName(i + 1), metadata.get(Constants.SQL_COLUMN_NAME_KEY));
assertEquals(rsmd.getColumnTypeName(i + 1), metadata.get(Constants.SQL_TYPE_KEY));
assertEquals(rsmd.getCatalogName(i), metadata.get(Constants.SQL_CATALOG_NAME_KEY));
assertEquals(rsmd.getTableName(i), metadata.get(Constants.SQL_TABLE_NAME_KEY));
assertEquals(rsmd.getColumnName(i), metadata.get(Constants.SQL_COLUMN_NAME_KEY));
assertEquals(rsmd.getColumnTypeName(i), metadata.get(Constants.SQL_TYPE_KEY));
}
}

Expand Down

0 comments on commit cc6cc88

Please sign in to comment.