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

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

Github user charsyam commented on the pull request:

    https://github.com/apache/tajo/pull/531#issuecomment-94029362
  
    Hi, @blrunner 
    CHAR type can have length. :)
    But if we make CHAR Column using this command
    
    in 
tajo-storage/tajo-storage-hdfs/src/test/java/org/apache/tajo/storage/parquet/TestReadWrite.java
    ```java
    columns.add(new Column("mychar", Type.CHAR)); 
    ``` 
    
    but it's length is 0, because it is just using CatalogUtil.newSimpleDataType
    
    and Scheme class already use condition code in addColumn method.
    But I think it can cause some mistakes easily.
    
    So I think it is better to move this condition code into 
CatalogUtil.newSimpleDataType
    What do you think?



> Refactoring condition code for CHAR into CatalogUtil
> ----------------------------------------------------
>
>                 Key: TAJO-1548
>                 URL: https://issues.apache.org/jira/browse/TAJO-1548
>             Project: Tajo
>          Issue Type: Improvement
>            Reporter: DaeMyung Kang
>            Assignee: DaeMyung Kang
>            Priority: Minor
>
> Currently Schema's addColumn is this
> ```java
>   public synchronized Schema addColumn(String name, Type type) {
>     if (type == Type.CHAR) {
>       return addColumn(name, CatalogUtil.newDataTypeWithLen(type, 1));
>     }
>     return addColumn(name, CatalogUtil.newSimpleDataType(type));
>   }
> ```
> I think it is better condition code into CatalogUtil.newSimpleDataType.
> because some testcode make columns just using CatalogUtil.



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

Reply via email to