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

ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 0.8.0
    • Fix Version/s: None
    • Component/s: JDBC
    • Labels:
      None

      Description

      ResultSetMetaData.getColumnType() always returns VARCHAR(string) as column type, no matter what the column type is for the partition column.

      However DatabaseMetadata.getColumnType() returns correct type.

      Create a table with a partition column having a type other than string, you will see that ResultSet.getColumnType() always returns string as the type for int or boolean or float columns...

        Activity

        Hide
        steffen.lutter Steffen added a comment -

        I encountered this issue as well and it would require me some efforts to work around this, so I'd be really happy if this will be fixed!

        Show
        steffen.lutter Steffen added a comment - I encountered this issue as well and it would require me some efforts to work around this, so I'd be really happy if this will be fixed!
        Hide
        phabricator@reviews.facebook.net Phabricator added a comment -

        tamtam180 requested code review of "HIVE-2703 [jira] ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type".
        Reviewers: JIRA

        https://issues.apache.org/jira/browse/HIVE-2703

        ResultSetMetaData.getColumnType() always returns VARCHAR(string) as column type, no matter what the column type is for the partition column.

        However DatabaseMetadata.getColumnType() returns correct type.

        Create a table with a partition column having a type other than string, you will see that ResultSet.getColumnType() always returns string as the type for int or boolean or float columns...

        TEST PLAN
        EMPTY

        REVISION DETAIL
        https://reviews.facebook.net/D2829

        AFFECTED FILES
        jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

        MANAGE HERALD DIFFERENTIAL RULES
        https://reviews.facebook.net/herald/view/differential/

        WHY DID I GET THIS EMAIL?
        https://reviews.facebook.net/herald/transcript/6423/

        Tip: use the X-Herald-Rules header to filter Herald messages in your client.

        Show
        phabricator@reviews.facebook.net Phabricator added a comment - tamtam180 requested code review of " HIVE-2703 [jira] ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type". Reviewers: JIRA https://issues.apache.org/jira/browse/HIVE-2703 ResultSetMetaData.getColumnType() always returns VARCHAR(string) as column type, no matter what the column type is for the partition column. However DatabaseMetadata.getColumnType() returns correct type. Create a table with a partition column having a type other than string, you will see that ResultSet.getColumnType() always returns string as the type for int or boolean or float columns... TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D2829 AFFECTED FILES jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/6423/ Tip: use the X-Herald-Rules header to filter Herald messages in your client.
        Hide
        tamtam180 tamtam180 added a comment -

        I was attach a patch.
        Could someone review this patch?

        Show
        tamtam180 tamtam180 added a comment - I was attach a patch. Could someone review this patch?
        Hide
        phabricator@reviews.facebook.net Phabricator added a comment -

        njain has accepted the revision "HIVE-2703 [jira] ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type".

        REVISION DETAIL
        https://reviews.facebook.net/D2829

        BRANCH
        svn

        Show
        phabricator@reviews.facebook.net Phabricator added a comment - njain has accepted the revision " HIVE-2703 [jira] ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type". REVISION DETAIL https://reviews.facebook.net/D2829 BRANCH svn
        Hide
        hudson Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #1392 (See https://builds.apache.org/job/Hive-trunk-h0.21/1392/)
        HIVE-2703 ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns
        irrespective of partition column type (tamtam180 via namit) (Revision 1329492)

        Result = FAILURE
        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1329492
        Files :

        • /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        Show
        hudson Hudson added a comment - Integrated in Hive-trunk-h0.21 #1392 (See https://builds.apache.org/job/Hive-trunk-h0.21/1392/ ) HIVE-2703 ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type (tamtam180 via namit) (Revision 1329492) Result = FAILURE namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1329492 Files : /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        Hide
        namit Namit Jain added a comment -
        Show
        namit Namit Jain added a comment - Re-opening. See https://issues.apache.org/jira/browse/HIVE-3059 for details.
        Hide
        hudson Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #1455 (See https://builds.apache.org/job/Hive-trunk-h0.21/1455/)
        HIVE-3059. Revert HIVE-2703, add testcase for non-string partition columns
        passed to transform operator, updated TestJdbcDriver.
        (Kevin Wilfong via namit) (Revision 1343331)

        Result = SUCCESS
        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1343331
        Files :

        • /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        • /hive/trunk/ql/src/test/queries/clientpositive/partcols1.q
        • /hive/trunk/ql/src/test/results/clientpositive/partcols1.q.out
        Show
        hudson Hudson added a comment - Integrated in Hive-trunk-h0.21 #1455 (See https://builds.apache.org/job/Hive-trunk-h0.21/1455/ ) HIVE-3059 . Revert HIVE-2703 , add testcase for non-string partition columns passed to transform operator, updated TestJdbcDriver. (Kevin Wilfong via namit) (Revision 1343331) Result = SUCCESS namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1343331 Files : /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java /hive/trunk/ql/src/test/queries/clientpositive/partcols1.q /hive/trunk/ql/src/test/results/clientpositive/partcols1.q.out
        Hide
        the6campbells N Campbell added a comment -

        Is this fix (or any other) addressing similar issues with respect to map, array, struct... where the type is always returned and described a string type?

        Show
        the6campbells N Campbell added a comment - Is this fix (or any other) addressing similar issues with respect to map, array, struct... where the type is always returned and described a string type?
        Hide
        hudson Hudson added a comment -

        Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/)
        HIVE-3059. Revert HIVE-2703, add testcase for non-string partition columns
        passed to transform operator, updated TestJdbcDriver.
        (Kevin Wilfong via namit) (Revision 1343331)
        HIVE-2703 ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns
        irrespective of partition column type (tamtam180 via namit) (Revision 1329492)

        Result = ABORTED
        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1343331
        Files :

        • /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        • /hive/trunk/ql/src/test/queries/clientpositive/partcols1.q
        • /hive/trunk/ql/src/test/results/clientpositive/partcols1.q.out

        namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1329492
        Files :

        • /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
        Show
        hudson Hudson added a comment - Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/ ) HIVE-3059 . Revert HIVE-2703 , add testcase for non-string partition columns passed to transform operator, updated TestJdbcDriver. (Kevin Wilfong via namit) (Revision 1343331) HIVE-2703 ResultSetMetaData.getColumnType() always returns VARCHAR(string) for partition columns irrespective of partition column type (tamtam180 via namit) (Revision 1329492) Result = ABORTED namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1343331 Files : /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java /hive/trunk/ql/src/test/queries/clientpositive/partcols1.q /hive/trunk/ql/src/test/results/clientpositive/partcols1.q.out namit : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1329492 Files : /hive/trunk/jdbc/src/test/org/apache/hadoop/hive/jdbc/TestJdbcDriver.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java

          People

          • Assignee:
            tamtam180 tamtam180
            Reporter:
            mgk.424@gmail.com Mythili Gopalakrishnan
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Development