You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tajo.apache.org by "Hyunsik Choi (JIRA)" <ji...@apache.org> on 2014/08/13 06:57:12 UTC
[jira] [Resolved] (TAJO-764) TajoResultSetMetaData::getColumnType
should use java.sql.Types
[ https://issues.apache.org/jira/browse/TAJO-764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hyunsik Choi resolved TAJO-764.
-------------------------------
Resolution: Invalid
> 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)