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

Mai Hai Thanh commented on TAJO-764:
------------------------------------

Hi [~hyunsik],
I examined this issue. Although the function name makes us expect something 
other than {{int}}, I think that the use of {{int}} instead of 
{{java.sql.Types}} here is correct.

> TajoResultSetMetaData::getColumnType should use java.sql.Types
> --------------------------------------------------------------
>
>                 Key: TAJO-764
>                 URL: https://issues.apache.org/jira/browse/TAJO-764
>             Project: Tajo
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 0.8.0
>            Reporter: Hyunsik Choi
>
> See the title.
> Currently, getColumnType method uses the following function. It returns 
> invalid integer values. We should fix it.
> {code}
> public static int tajoTypeToSqlType(TajoDataTypes.DataType type) throws 
> SQLException {
>     switch (type.getType()) {
>     case BOOLEAN:
>       return Types.BOOLEAN;
>     case INT1:
>       return Types.TINYINT;
>     case INT2:
>       return Types.SMALLINT;
>     case INT4:
>       return Types.INTEGER;
>     case INT8:
>       return Types.BIGINT;
>     case FLOAT4:
>       return Types.FLOAT;
>     case FLOAT8:
>       return Types.DOUBLE;
>     case NUMERIC:
>       return Types.NUMERIC;
>     case DATE:
>       return Types.TIMESTAMP;
>     case VARCHAR:
>       return Types.VARCHAR;
>     case TEXT:
>       return Types.VARCHAR;
>     default:
>       throw new SQLException("Unrecognized column type: " + type);
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to