Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Getting error Required field 'client_protocol' is unset! while connecting to hive database using hive-jdbc


I have setup the HDP 2.6 cluster and primarily using the hive. Have created the hive database and hive tables. When I tried to connect to the hiveserver using hive-jdbc and seeing the above error. Tried to search google for help but no luck.

I am using the following jdbc driver:

I was seeing this error while trying to connect from BI, and wrote a simple JDBC client code and seeing the same error from the this client code too..

Here is the exception stack trace from the client code. Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default})
    at ~[hive-jdbc-]
    at ~[hive-jdbc-]
    at org.apache.hive.service.rpc.thrift.TCLIService$Client.recv_OpenSession( ~[hive-jdbc-]
    at org.apache.hive.service.rpc.thrift.TCLIService$Client.OpenSession( ~[hive-jdbc-]
    at org.apache.hive.jdbc.HiveConnection.openSession( [hive-jdbc-]
    at org.apache.hive.jdbc.HiveConnection.<init>( [hive-jdbc-]
    at org.apache.hive.jdbc.HiveDriver.connect( [hive-jdbc-]
    at java.sql.DriverManager.getConnection( [?:1.8.0_144]
    at java.sql.DriverManager.getConnection( [?:1.8.0_144]

Looks like


Expert Contributor

@Bala Kolla can you please update the query with jdbc connection string, issue might be with the connection string parameters or the second possible issue could be with version mismatch. can you use the hive-jdbc jar provided by HDP installable rather than donwloading from web ?


Looks like this is something to do with the driver.. I am not seeing this error anymore once I switched the driver to


I am suspecting that cognos is not compatible with the hive-jdbc-2.x