Skip to content

Instantly share code, notes, and snippets.

@cupdike
Created July 12, 2017 20:12
Show Gist options
  • Save cupdike/7b99e285573e0bd89d2f7e276e1f726f to your computer and use it in GitHub Desktop.
Save cupdike/7b99e285573e0bd89d2f7e276e1f726f to your computer and use it in GitHub Desktop.
Bash commands that will provide the list of jars needed to run beeline without installing hive
# If you want to run Beeline without installing Hive...
# This will help you find the jars that you need:
# Ref: https://pvillaflores.wordpress.com/2017/04/30/installing-and-running-beeline-client/
# Turn on verbose classloading
$ export _JAVA_OPTIONS=-verbose:class
# Run beeline and process out the needed jars.
# Below assumes the hadoop jars are under a 'cloudera' path (adjust accordingly)
$ /usr/bin/beeline | tr '[' '\n' | tr ']' ' ' | grep jar | grep cloudera | grep -v checksum | awk '{last=split($0,a,"/"); print a[last]}' | sort | uniq
### Here's some sample output:
Picked up _JAVA_OPTIONS: -verbose:class
apache-log4j-extras-1.2.17.jar
commons-logging-1.1.3.jar
hive-jdbc-1.1.0-cdh5.XX.0-standalone.jar
log4j-1.2.16.jar
slf4j-log4j12-1.7.5.jar
spark-assembly-1.6.0-cdh5.11.0-hadoop2.6.0-cdh5.XX.0.jar
spark-assembly-1.6.0-cdh5.11.0-hadoop2.6.0-cdh5.XX.0.jar
# Then, run beeline and use
$ ps aux | grep beeline
# To find the command you'll need to run (with the listed jars on the classpath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment