You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Miklos Christine (JIRA)" <ji...@apache.org> on 2013/06/21 01:47:21 UTC
[jira] [Created] (HIVE-4775) getColumnTypeName returns string for
int partition columns
Miklos Christine created HIVE-4775:
--------------------------------------
Summary: getColumnTypeName returns string for int partition columns
Key: HIVE-4775
URL: https://issues.apache.org/jira/browse/HIVE-4775
Project: Hive
Issue Type: Bug
Components: JDBC
Affects Versions: 0.9.0
Reporter: Miklos Christine
For an 'int' partition column, the 'getColumnTypeName' metadata call is returning type 'string'. However, a DESCRIBE correctly returns type 'int'.
Doug Sedlak mentioned this issue in a comment of Hive-2315. https://issues.apache.org/jira/browse/HIVE-2315
A patch was submitted, but the ticket was closed before then.
This appears to be a bug.
Similar issue here to address the consistency of the call:
https://issues.apache.org/jira/browse/HIVE-4519
Sample table is:
create EXTERNAL table partition_by_int (str_val string) PARTITIONED BY (int_col INT) ROW FORMAT delimited fields terminated by ',' STORED AS TEXTFILE;
And (shortened) JDBC code is:
res = stmt.executeQuery("select * from partition_by_int");
ResultSetMetaData metaData = res.getMetaData();
for (int i = 0; i < metaData.getColumnCount(); i++)
{ System.out.print(metaData.getColumnName(i + 1) + " \t"); System.out.print(metaData.getColumnDisplaySize(i + 1) + "\t"); System.out.println(metaData.getColumnTypeName(i + 1)); }
With output:
str_val 2147483647 string
int_col 2147483647 string
In contrast, DESCRIBE partition_by_int generates:
str_val string
int_col int
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira