[ 
https://issues.apache.org/jira/browse/TAJO-1421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14393867#comment-14393867
 ] 

ASF GitHub Bot commented on TAJO-1421:
--------------------------------------

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_"));
    ```


> Add 'ALTER TABLE SET PROPERTY' statement
> ----------------------------------------
>
>                 Key: TAJO-1421
>                 URL: https://issues.apache.org/jira/browse/TAJO-1421
>             Project: Tajo
>          Issue Type: New Feature
>          Components: catalog, storage
>            Reporter: Hyunsik Choi
>            Assignee: Yongjin Choi
>             Fix For: 0.11.0
>
>         Attachments: TAJO-1421.yongjin.patch, TAJO-1421_2.patch
>
>
> Each table has table properties. Currently, users can only set table 
> properties only when a table is created. But, in many cases, we need to 
> change table properties later.
> To allow users to change table properties of an existing table, I propose 
> 'ALTER TABLE SET PROPERTY' statement.
> The proposed grammar is as follow:
> {code}
> ALTER TABLE SET PROPERTY property_name = property_value, ..., property_name = 
> property_value;
> {code}
> {{property_name=property_value}} can be listed by comma chain.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to