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

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

Github user jihoonson commented on the pull request:

    https://github.com/apache/tajo/pull/503#issuecomment-101492752
  
    Thanks @charsyam. The above bug looks fixed.
    Additionally, I have three comments as follows.
    * Please follow our convention for indent.
    * TestInsertQuery is a class to test Tajo's insert function rather than 
select result. I think that TestStorages looks a good place to test the 
character type for several types of storage.
    * Please consider the following case. I think that 
```ValueTooLongForTypeCharactersException``` should be thrown instead of 
```java.lang.ArrayIndexOutOfBoundsException```.
    
    ```
    default> \dfs -cat hdfs://localhost:7020/test
    cat: `hdfs://localhost:7020/test': Is a directory
    default> \dfs -cat hdfs://localhost:7020/test/test.csv
    1|a|1
    2|bb|2
    3|ccc|3
    4|dddd|4
    5|eeeee|5
    
    default> create external table test ( id int, name char(3), score int ) 
using text with ('text.delimiter'='|') location 'hdfs://localhost:7020/test';
    OK
    
    default> \d test
    
    table name: default.test
    table path: hdfs://localhost:7020/test
    store type: text
    number of rows: unknown
    volume: 40 B
    Options: 
        'text.delimiter'='|'
    
    schema: 
    id  INT4
    name        CHAR(3)
    score       INT4
    
    default> select * from test;
    id,  name,  score
    -------------------------------
    ERROR: java.lang.ArrayIndexOutOfBoundsException
    java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException
        at 
org.apache.tajo.jdbc.TajoResultSetBase.next(TajoResultSetBase.java:786)
        at 
org.apache.tajo.cli.tsql.DefaultTajoCliOutputFormatter.printResult(DefaultTajoCliOutputFormatter.java:105)
        at 
org.apache.tajo.cli.tsql.TajoCli.localQueryCompleted(TajoCli.java:558)
        at org.apache.tajo.cli.tsql.TajoCli.executeQuery(TajoCli.java:532)
        at 
org.apache.tajo.cli.tsql.TajoCli.executeParsedResults(TajoCli.java:447)
        at org.apache.tajo.cli.tsql.TajoCli.runShell(TajoCli.java:419)
        at org.apache.tajo.cli.tsql.TajoCli.main(TajoCli.java:692)
    Caused by: java.io.IOException: java.lang.ArrayIndexOutOfBoundsException
        at org.apache.tajo.jdbc.FetchResultSet.nextTuple(FetchResultSet.java:87)
        at 
org.apache.tajo.jdbc.TajoResultSetBase.next(TajoResultSetBase.java:780)
        ... 6 more
    Caused by: com.google.protobuf.ServiceException: 
java.lang.ArrayIndexOutOfBoundsException
        at 
org.apache.tajo.client.QueryClientImpl.fetchNextQueryResult(QueryClientImpl.java:370)
        at 
org.apache.tajo.client.TajoClientImpl.fetchNextQueryResult(TajoClientImpl.java:134)
        at org.apache.tajo.jdbc.FetchResultSet.nextTuple(FetchResultSet.java:69)
        ... 7 more
    ```
    
    ---
    
    
    
    
    
    
    
    Comments from the [review on 
Reviewable.io](https://reviewable.io:443/reviews/apache/tajo/503)
    <!-- Sent from Reviewable.io -->



> Datum 'Char' returned only 1byte.
> ---------------------------------
>
>                 Key: TAJO-1485
>                 URL: https://issues.apache.org/jira/browse/TAJO-1485
>             Project: Tajo
>          Issue Type: Bug
>            Reporter: Seungun Choe
>            Assignee: DaeMyung Kang
>            Priority: Minor
>             Fix For: 0.11.0, 0.10.1
>
>
> Even though table's column have long char data, 'Char Datum' only returns 
> 1byte.
> {quote}
> create table test1 (col1 char(5));
> insert into test1 select 'a';
> insert into test1 select 'abc';
> insert into test1 select 'abcde';
> select * from test1;
> col1
> -------------------------------
> a
> a
> a
> (3 rows, 0.151 sec, 6 B selected)
> {quote}



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

Reply via email to