hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thejas M Nair (JIRA)" <>
Subject [jira] [Commented] (HIVE-6050) JDBC backward compatibility is broken
Date Mon, 06 Jan 2014 21:25:52 GMT


Thejas M Nair commented on HIVE-6050:

bq. Do you guys have any thoughts on which would be a more common scenario to support: new
jdbc driver compatible with old server version or old jdbc driver compatible with a newer
server version?
I think it is very important that one version of jdbc driver be able to talk to different
versions of HS2. If the older version of driver is able to talk to newer versions of HS2,
that would be the ideal case.

> JDBC backward compatibility is broken
> -------------------------------------
>                 Key: HIVE-6050
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, JDBC
>            Reporter: Szehon Ho
>            Assignee: Carl Steinbach
>            Priority: Blocker
> Connect from JDBC driver of Hive 0.13 (TProtocolVersion=v4) to HiveServer2 of Hive 0.10
(TProtocolVersion=v1), will return the following exception:
> {noformat}
> java.sql.SQLException: Could not establish connection to jdbc:hive2://localhost:10000/default:
Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null)
> 	at org.apache.hive.jdbc.HiveConnection.openSession(
> 	at org.apache.hive.jdbc.HiveConnection.<init>(
> 	at org.apache.hive.jdbc.HiveDriver.connect(
> 	at java.sql.DriverManager.getConnection(
> 	at java.sql.DriverManager.getConnection(
> 	at org.apache.hive.jdbc.MyTestJdbcDriver2.getConnection(
> 	at org.apache.hive.jdbc.MyTestJdbcDriver2.&lt;init&gt;(
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
> 	at java.lang.reflect.Constructor.newInstance(
> 	at org.junit.runners.BlockJUnit4ClassRunner.createTest(
> 	at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(
> 	at
> 	at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> 	at org.junit.runners.ParentRunner$
> 	at org.junit.runners.ParentRunner$1.schedule(
> 	at org.junit.runners.ParentRunner.runChildren(
> 	at org.junit.runners.ParentRunner.access$000(
> 	at org.junit.runners.ParentRunner$2.evaluate(
> 	at
> 	at
> 	at
> 	at
> 	at
> Caused by: org.apache.thrift.TApplicationException: Required field 'client_protocol'
is unset! Struct:TOpenSessionReq(client_protocol:null)
> 	at
> 	at org.apache.thrift.TServiceClient.receiveBase(
> 	at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(
> 	at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(
> 	at org.apache.hive.jdbc.HiveConnection.openSession(
> 	... 37 more
> {noformat}
> On code analysis, it looks like the 'client_protocol' scheme is a ThriftEnum, which doesn't
seem to be backward-compatible.  Look at the code path in the generated file '',
> 1. The method will call 'TProtocolVersion.findValue()' on the thrift protocol's byte
stream, which returns null if the client is sending an enum value unknown to the server. 
(v4 is unknown to server)
> 2. The method will then call struct.validate(), which will throw the above exception
because of null version.  
> So doesn't look like the current backward-compatibility scheme will work.

This message was sent by Atlassian JIRA

View raw message