hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "qiaohaijun (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-6050) JDBC backward compatibility is broken
Date Sat, 01 Nov 2014 11:15:34 GMT

    [ https://issues.apache.org/jira/browse/HIVE-6050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14193085#comment-14193085
] 

qiaohaijun commented on HIVE-6050:
----------------------------------

14/11/01 19:12:44 ERROR jdbc.HiveConnection: Error opening session
org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null)
	at org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71)
	at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:156)
	at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:143)
	at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:415)
	at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:193)
	at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
	at java.sql.DriverManager.getConnection(DriverManager.java:571)
	at java.sql.DriverManager.getConnection(DriverManager.java:187)
	at org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145)
	at org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:186)
	at org.apache.hive.beeline.Commands.connect(Commands.java:959)
	at org.apache.hive.beeline.Commands.connect(Commands.java:880)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:44)
	at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:801)
	at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:659)
	at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:368)
	at org.apache.hive.beeline.BeeLine.main(BeeLine.java:351)
Error: Invalid URL: jdbc:hive2://10.134.34.181:10000 (state=08S01,code=0)

---
spark 1.1.1
hive 0.12-probuf-2.5

> JDBC backward compatibility is broken
> -------------------------------------
>
>                 Key: HIVE-6050
>                 URL: https://issues.apache.org/jira/browse/HIVE-6050
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2, JDBC
>    Affects Versions: 0.13.0
>            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(HiveConnection.java:336)
> 	at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:158)
> 	at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:571)
> 	at java.sql.DriverManager.getConnection(DriverManager.java:187)
> 	at org.apache.hive.jdbc.MyTestJdbcDriver2.getConnection(MyTestJdbcDriver2.java:73)
> 	at org.apache.hive.jdbc.MyTestJdbcDriver2.&lt;init&gt;(MyTestJdbcDriver2.java:49)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:187)
> 	at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> 	at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39)
> 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:523)
> 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1063)
> 	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:914)
> Caused by: org.apache.thrift.TApplicationException: Required field 'client_protocol'
is unset! Struct:TOpenSessionReq(client_protocol:null)
> 	at org.apache.thrift.TApplicationException.read(TApplicationException.java:108)
> 	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:71)
> 	at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:160)
> 	at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:147)
> 	at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:327)
> 	... 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 'TOpenSessionReq.java',
method TOpenSessionReqStandardScheme.read():
> 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
(v6.3.4#6332)

Mime
View raw message