You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Doug Sedlak (Commented) (JIRA)" <ji...@apache.org> on 2011/11/14 22:24:53 UTC
[jira] [Commented] (HIVE-2315) DatabaseMetadata.getColumns() does
not return partition column names for a table
[ https://issues.apache.org/jira/browse/HIVE-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13149933#comment-13149933 ]
Doug Sedlak commented on HIVE-2315:
-----------------------------------
For an 'int' partition column, the 'getColumnTypeName' metadata call is returning type 'string'. However, a DESCRIBE correctly returns type 'int'. Seems like a bug if it replicates for others? I have the patched code in place on both client and server. Thanks!
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
> DatabaseMetadata.getColumns() does not return partition column names for a table
> --------------------------------------------------------------------------------
>
> Key: HIVE-2315
> URL: https://issues.apache.org/jira/browse/HIVE-2315
> Project: Hive
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 0.7.1
> Reporter: Mythili Gopalakrishnan
> Assignee: Patrick Hunt
> Priority: Critical
> Fix For: 0.8.0
>
> Attachments: HIVE-2315.patch, HIVE-2315.patch
>
>
> getColumns() method of DatabaseMetadata for HIVE JDBC Driver does not return the partition column names. Where as from HIVE CLI, if you do a 'describe tablename' you get all columns including the partition columns. It would be nice if getColumns() method returns all columns.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira