hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Sedlak (Commented) (JIRA)" <>
Subject [jira] [Commented] (HIVE-2315) DatabaseMetadata.getColumns() does not return partition column names for a table
Date Mon, 14 Nov 2011 21:24:53 GMT


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:
>             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:!default.jspa
For more information on JIRA, see:


View raw message