Support Questions

Find answers, ask questions, and share your expertise

Unable to Execute any Hive Query

Hi,

Unable to execute any hive query after executing (export USE_DEPRECATED_CLI=false).

Someone, please share the solution

 

[cloudera@quickstart ~]$ hive
scan complete in 5ms
Connecting to jdbc:hive2://
20/03/29 07:11:28 [main]: WARN session.HiveSessionImpl: Unable to create operation log session directory: /var/log/hive/operation_logs/a5e438f0-463f-458d-95cc-ceb825c584bd
Connected to: Apache Hive (version 1.1.0-cdh5.13.0)
Driver: Hive JDBC (version 1.1.0-cdh5.13.0)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 1.1.0-cdh5.13.0 by Apache Hive
hive>
hive>
hive>
hive> use cards;
20/03/29 07:11:52 [HiveServer2-Background-Pool: Thread-22-SendThread(quickstart.cloudera:2181)]: WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)

 

Regards,

4 REPLIES 4

Expert Contributor

The connection to zookeeper seems to fail from hs2. Is your zookeeper up and running? Also is Zookeeper service dependency enabled in HS2 configuration 

(CM > Hive > Configuration >ZooKeeper Service > Select service > Save and Restart)

I have removed/Rollback export USE_DEPRECATED_CLI=false using below

if [ -n '$USE_DEPRECATED_CLI' ]; then
USE_DEPRECATED_CLI="true"
fi

$ echo $USE_DEPRECATED_CLI
false
$ echo '$USE_DEPRECATED_CLI'
$USE_DEPRECATED_CLI
$

and now able to execute the query..But unable to create a hive table it's stuck with the running status .. Pls suggest how to fix this? ..(using 8 GB RAM, system).

 

[cloudera@quickstart ~]$ hive

Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-1.1.0-cdh5.13.0.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive>
>
> use cards;
OK
Time taken: 69.268 seconds
hive>
>
>
> CREATE TABLE deck_of_cards (
> COLOR string,
> SUIT string,
> PIP string)
> ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
> STORED AS TEXTFILE;

and stuck with the running status ...

 

Regards,

 

 

It seems your Zookeeper is not working properly. Take a zookeeper restart or full Cloudera restart. 

It's working now, After restarting Zookeeper.

Thank You So Much 

 

Regards,