Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-4775

getColumnTypeName returns string for int partition columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.9.0
    • None
    • JDBC
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            mwc Miklos Christine
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: