Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

connection issue from beeline to hive

connection issue from beeline to hive




I am unable to connect from beeline to hive meatstore. i am attaching the error which was thrown.


Please help me resolve this issue.


Thanks in advance




[centos@e1 ~]$ beeline
Beeline version 1.2.1.spark2 by Apache Hive
beeline> !connect jdbc:hive2://
Connecting to jdbc:hive2://
Enter username for jdbc:hive2:// hive
Enter password for jdbc:hive2:// ********
2018-09-10 12:26:25 INFO  Utils:310 - Supplied authorities:
2018-09-10 12:26:25 INFO  Utils:397 - Resolved authority:
2018-09-10 12:26:25 INFO  HiveConnection:203 - Will try to open client transport with JDBC Uri: jdbc:hive2://
2018-09-10 12:26:25 ERROR HiveConnection:593 - Error opening session
org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default})
        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(
        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.beeline.DatabaseConnection.connect(
        at org.apache.hive.beeline.DatabaseConnection.getConnection(
        at org.apache.hive.beeline.Commands.connect(
        at org.apache.hive.beeline.Commands.connect(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.hive.beeline.ReflectiveCommandHandler.execute(
        at org.apache.hive.beeline.BeeLine.dispatch(
        at org.apache.hive.beeline.BeeLine.execute(
        at org.apache.hive.beeline.BeeLine.begin(
        at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(
        at org.apache.hive.beeline.BeeLine.main(
Error: Could not establish connection to jdbc:hive2:// Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}) (state=08S01,code=0)
0: jdbc:hive2:// (closed)>



Re: connection issue from beeline to hive

Please try one of below:

1. in beeline run:
!connect 'jdbc:hive2://'

2. from shell command line:
beeline -u 'jdbc:hive2://'

See if that helps