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

        Thejas M Nair created issue -
        Thejas M Nair made changes -
        Field Original Value New Value
        Attachment HIVE-4269.1.patch [ 12576296 ]
        Thejas M Nair made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Thejas M Nair added a comment -
        Show
        Thejas M Nair added a comment - reviewboard link - https://reviews.apache.org/r/10210/
        Thejas M Nair made changes -
        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.
         
        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 -
        {code}
            [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)

        {code}
        Hide
        Ashutosh Chauhan added a comment -

        +1 running tests.

        Show
        Ashutosh Chauhan added a comment - +1 running tests.
        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.
        Ashutosh Chauhan made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        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 -

        Committed to trunk. Thanks, Thejas!

        Show
        Ashutosh Chauhan added a comment - Committed to trunk. Thanks, Thejas!
        Ashutosh Chauhan made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        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
        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
        Owen O'Malley made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        2m 55s 1 Thejas M Nair 31/Mar/13 19:08
        Patch Available Patch Available Open Open
        1d 10h 2m 1 Ashutosh Chauhan 02/Apr/13 05:11
        Open Open Resolved Resolved
        1d 9h 11m 1 Ashutosh Chauhan 03/Apr/13 14:22
        Resolved Resolved Closed Closed
        43d 6h 47m 1 Owen O'Malley 16/May/13 21:10

          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