How can I install the hive client beeline without having to install all the hive/hadoop ecosystem on my laptop?

I want to use it to query a remote Hive database.


It is not necessary to install beeline/hive. All you have to do is collect the relevant jars from your system and copy them and place them in a single folder.

Suppose, we have a source system where you have beeline and a target system where you want to run beeline.

On the source system collect the relevant jars into one folder. The best way I have found to identify the exact jars involved is to use the jvm option: -verbose:class

I.e., you should be able to issue a java command that will replicate a typical beeline command invocation on the source system.

Then copy those files into one folder on the target system. cd to that folder to make the -classpath reference later simple.

I use an HDP 2.5 Hortonworks distro. For me, the following invocation on the target system works: java -Xmx1024m -classpath apache-log4j-extras-1.2.17.jar:avatica- -Dhdp.version= -Djava.net.preferIPv4Stack=true -Dhdp.version= -Dhadoop.log.dir=/home/userid -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=/home/userid -Dhadoop.id.str=userid -Dhadoop.root.logger=INFO,console -Djava.library.path=:/home/userid -Dhadoop.policy.file=hadoop-policy.xml -Djava.net.preferIPv4Stack=true -Djava.util.logging.config.file=/home/userid/parquet-logging.properties -Dlog4j.configuration=beeline-log4j.properties -Dhadoop.security.logger=INFO,NullAppender org.apache.hadoop.util.RunJar /home/userid/hive-beeline-1.2.1000. org.apache.hive.beeline.BeeLine -n userid -p pass -u "jdbc:hive2://knox.company.com:8000/;ssl=true;transportMode=http;httpPath=gateway/tdcprd/hive"

Some of the parameters are probably not necessary, but I kept them because that is how it is done on the source system. You should use source system's java invocation as a reference pattern.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.