diff --git a/bin/ext/cli.sh b/bin/ext/cli.sh index 914aae3..733705a 100644 --- a/bin/ext/cli.sh +++ b/bin/ext/cli.sh @@ -16,13 +16,22 @@ THISSERVICE=cli export SERVICE_LIST="${SERVICE_LIST}${THISSERVICE} " +updateCli() { + if [ $USE_DEPRECATED_CLI == "true" ]; then + CLASS=org.apache.hadoop.hive.cli.CliDriver + JAR=hive-cli-*.jar + else + CLASS=org.apache.hive.beeline.cli.HiveCli + JAR=hive-beeline-*.jar + fi +} + cli () { - CLASS=org.apache.hadoop.hive.cli.CliDriver - execHiveCmd $CLASS "$@" + updateCli + execHiveCmd $CLASS $JAR "$@" } cli_help () { - CLASS=org.apache.hadoop.hive.cli.CliDriver - execHiveCmd $CLASS "--help" -} - + updateCli + execHiveCmd $CLASS $JAR "--help" +} \ No newline at end of file diff --git a/bin/ext/util/execHiveCmd.sh b/bin/ext/util/execHiveCmd.sh index 167cc40..e46ec3c 100644 --- a/bin/ext/util/execHiveCmd.sh +++ b/bin/ext/util/execHiveCmd.sh @@ -16,9 +16,11 @@ execHiveCmd () { CLASS=$1; shift; + JAR=$1 + shift; # cli specific code - if [ ! -f ${HIVE_LIB}/hive-cli-*.jar ]; then + if [ ! -f ${HIVE_LIB}/$JAR ]; then echo "Missing Hive CLI Jar" exit 3; fi @@ -28,5 +30,5 @@ execHiveCmd () { fi # hadoop 20 or newer - skip the aux_jars option. picked up from hiveconf - exec $HADOOP jar ${HIVE_LIB}/hive-cli-*.jar $CLASS $HIVE_OPTS "$@" + exec $HADOOP jar ${HIVE_LIB}/$JAR $CLASS $HIVE_OPTS "$@" }