From cc6cc88a929e17c496c03664783f60fc3066b01c Mon Sep 17 00:00:00 2001 From: Mike Pigott Date: Sun, 3 Feb 2019 12:18:40 -0500 Subject: [PATCH] ARROW-3966: Using a 1:N loop instead of a 0:N-1 loop for fewer index offsets in code. --- .../arrow/adapter/jdbc/JdbcToArrowTestHelper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java index de15f54212418..3e1eb09d1f590 100644 --- a/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java +++ b/java/adapter/jdbc/src/test/java/org/apache/arrow/adapter/jdbc/JdbcToArrowTestHelper.java @@ -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 metadata = fields.get(i).getMetadata(); + for (int i = 1; i <= rsmd.getColumnCount(); ++i) { + Map 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)); } }