Github user blrunner commented on a diff in the pull request:
https://github.com/apache/tajo/pull/450#discussion_r27710739
--- Diff:
tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
---
@@ -1023,6 +1026,77 @@ public void
alterTable(CatalogProtos.AlterTableDescProto alterTableDescProto) th
}
+ private Map<String, String> getTableOptions(final int tableId) throws
CatalogException {
+ Connection conn = null;
+ PreparedStatement pstmt = null;
+ ResultSet res = null;
+ Map<String, String> options = TUtil.newHashMap();
+
+ try {
+ String tidSql = "SELECT key_, value_ FROM " + TB_OPTIONS + " WHERE
TID=?";
+
+ conn = getConnection();
+ pstmt = conn.prepareStatement(tidSql);
+ pstmt.setInt(1, tableId);
+ res = pstmt.executeQuery();
+
+ while (res.next()) {
+ String key = res.getString("KEY_");
+ String value = res.getString("VALUE_");
+ options.put(key, value);
--- End diff --
New objects looks like unnecessary resources. I would like t more better if
you don't create new String objects as follows.
```
options.put(res.getString("KEY_"), res.getString("VALUE_"));
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---