Hive
  1. Hive
  2. HIVE-4269

fix handling of binary type in hiveserver2, jdbc driver

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.11.0
    • Component/s: HiveServer2
    • Labels:
      None

      Description

      Need to use 'new String(byte[])' instead of 'byte[].toString()' when converting to String for jdbc, in SQLOperation.convertLazyToJava()
      Need to add support for binary in jdbc driver code.

      THe exception that gets thrown while trying to access binary column is like this -

          [junit] org.apache.hive.service.cli.HiveSQLException: java.lang.ClassCastException: [B cannot be cast to java.lang.String
          [junit]     at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:188)
          [junit]     at org.apache.hive.service.cli.operation.OperationManager.getOperationNextRowSet(OperationManager.java:170)
          [junit]     at org.apache.hive.service.cli.session.HiveSessionImpl.fetchResults(HiveSessionImpl.java:324)
          [junit]     at org.apache.hive.service.cli.CLIService.fetchResults(CLIService.java:290)
      
      
      1. HIVE-4269.1.patch
        6 kB
        Thejas M Nair

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-hadoop2 #138 (See https://builds.apache.org/job/Hive-trunk-hadoop2/138/)
        HIVE-4269 : fix handling of binary type in hiveserver2, jdbc driver (Thejas Nair via Ashutosh Chauhan) (Revision 1464037)

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

        • /hive/trunk/data/files/datatypes.txt
        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java
        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java
        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java
        • /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        • /hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
        Show
        Hudson added a comment - Integrated in Hive-trunk-hadoop2 #138 (See https://builds.apache.org/job/Hive-trunk-hadoop2/138/ ) HIVE-4269 : fix handling of binary type in hiveserver2, jdbc driver (Thejas Nair via Ashutosh Chauhan) (Revision 1464037) Result = FAILURE hashutosh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1464037 Files : /hive/trunk/data/files/datatypes.txt /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java /hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #2043 (See https://builds.apache.org/job/Hive-trunk-h0.21/2043/)
        HIVE-4269 : fix handling of binary type in hiveserver2, jdbc driver (Thejas Nair via Ashutosh Chauhan) (Revision 1464037)

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

        • /hive/trunk/data/files/datatypes.txt
        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java
        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java
        • /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java
        • /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java
        • /hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #2043 (See https://builds.apache.org/job/Hive-trunk-h0.21/2043/ ) HIVE-4269 : fix handling of binary type in hiveserver2, jdbc driver (Thejas Nair via Ashutosh Chauhan) (Revision 1464037) Result = FAILURE hashutosh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1464037 Files : /hive/trunk/data/files/datatypes.txt /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveBaseResultSet.java /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/HiveResultSetMetaData.java /hive/trunk/jdbc/src/java/org/apache/hive/jdbc/Utils.java /hive/trunk/jdbc/src/test/org/apache/hive/jdbc/TestJdbcDriver2.java /hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
        Hide
        Ashutosh Chauhan added a comment -

        Committed to trunk. Thanks, Thejas!

        Show
        Ashutosh Chauhan added a comment - Committed to trunk. Thanks, Thejas!
        Hide
        Ashutosh Chauhan added a comment -

        I tried it on clean checkout again and test passed, so I will treat it as a transient. Running tests again. Will commit if tests pass.

        Show
        Ashutosh Chauhan added a comment - I tried it on clean checkout again and test passed, so I will treat it as a transient. Running tests again. Will commit if tests pass.
        Hide
        Ashutosh Chauhan added a comment -

        hiveprofiler0.q test failed.

            [junit] Begin query: hiveprofiler0.q
            [junit] Running: diff -a /home/ashutosh/hive/build/ql/test/logs/clientpositive/hiveprofiler0.q.out /home/ashutosh/hive/ql/src/test/results/clientpositive/hiveprofiler0.q.out
            [junit] 4a5,11
            [junit] > TS_0 ==> SEL_1: 500
            [junit] > main() ==> RS_3: 1
            [junit] > SEL_1 ==> GBY_2: 500
            [junit] > main() ==> SEL_5: 1
            [junit] > main() ==> GBY_4: 1
            [junit] > main() ==> TS_0: 500
            [junit] > SEL_5 ==> FS_6: 1
            [junit] Exception: Client execution results failed with error code = 1
            [junit] See build/ql/tmp/hive.log, or try "ant test ... -Dtest.silent=false" to get more logs.
            [junit] Failed query: hiveprofiler0.q
        
        

        Not sure the reason for the failure.

        Show
        Ashutosh Chauhan added a comment - hiveprofiler0.q test failed. [junit] Begin query: hiveprofiler0.q [junit] Running: diff -a /home/ashutosh/hive/build/ql/test/logs/clientpositive/hiveprofiler0.q.out /home/ashutosh/hive/ql/src/test/results/clientpositive/hiveprofiler0.q.out [junit] 4a5,11 [junit] > TS_0 ==> SEL_1: 500 [junit] > main() ==> RS_3: 1 [junit] > SEL_1 ==> GBY_2: 500 [junit] > main() ==> SEL_5: 1 [junit] > main() ==> GBY_4: 1 [junit] > main() ==> TS_0: 500 [junit] > SEL_5 ==> FS_6: 1 [junit] Exception: Client execution results failed with error code = 1 [junit] See build/ql/tmp/hive.log, or try "ant test ... -Dtest.silent=false" to get more logs. [junit] Failed query: hiveprofiler0.q Not sure the reason for the failure.
        Hide
        Ashutosh Chauhan added a comment -

        +1 running tests.

        Show
        Ashutosh Chauhan added a comment - +1 running tests.
        Hide
        Thejas M Nair added a comment -
        Show
        Thejas M Nair added a comment - reviewboard link - https://reviews.apache.org/r/10210/

          People

          • Assignee:
            Thejas M Nair
            Reporter:
            Thejas M Nair
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development