Skip to content

Commit

Permalink
ARROW-3966: Code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Pigott committed Feb 5, 2019
1 parent cc6cc88 commit 65741a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public BaseAllocator getAllocator() {
*
* @return <code>true</code> to include field metadata, <code>false</code> to exclude it.
*/
public boolean getIncludeMetadata() {
public boolean shouldIncludeMetadata() {
return includeMetadata;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ public static Schema jdbcToArrowSchema(ResultSetMetaData rsmd, JdbcToArrowConfig
final FieldType fieldType;

final Map<String, String> metadata;
if (config.getIncludeMetadata()) {
metadata = new HashMap<String, String>();
if (config.shouldIncludeMetadata()) {
metadata = new HashMap<>();
metadata.put(Constants.SQL_CATALOG_NAME_KEY, rsmd.getCatalogName(i));
metadata.put(Constants.SQL_TABLE_NAME_KEY, rsmd.getTableName(i));
metadata.put(Constants.SQL_COLUMN_NAME_KEY, columnName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ public void testConfig() {
JdbcToArrowConfigBuilder builder = new JdbcToArrowConfigBuilder(allocator, calendar, false);

JdbcToArrowConfig config = builder.build();
assertFalse(config.getIncludeMetadata());
assertFalse(config.shouldIncludeMetadata());

builder.setIncludeMetadata(true);
config = builder.build();
assertTrue(config.getIncludeMetadata());
assertTrue(config.shouldIncludeMetadata());

config = new JdbcToArrowConfigBuilder(allocator, calendar, true).build();
assertTrue(config.getIncludeMetadata());
assertTrue(config.shouldIncludeMetadata());

config = new JdbcToArrowConfig(allocator, calendar, true);
assertTrue(config.getIncludeMetadata());
assertTrue(config.shouldIncludeMetadata());

config = new JdbcToArrowConfig(allocator, calendar, false);
assertFalse(config.getIncludeMetadata());
assertFalse(config.shouldIncludeMetadata());
}
}

0 comments on commit 65741a9

Please sign in to comment.