Repository: hive Updated Branches: refs/heads/beeline-cli 9bc1b3bf2 -> 2ddd86de5
HIVE-10624: Update the initial script to make beeline bucked cli as default and allow user choose old hive cli by env (Ferdinand via Xuefu) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/2ddd86de Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/2ddd86de Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/2ddd86de Branch: refs/heads/beeline-cli Commit: 2ddd86de5e005eb0457cc8bf0da47aa6c4d99c27 Parents: 9bc1b3b Author: Xuefu Zhang <[email protected]> Authored: Sat May 9 03:58:25 2015 -0700 Committer: Xuefu Zhang <[email protected]> Committed: Sat May 9 03:58:25 2015 -0700 ---------------------------------------------------------------------- bin/ext/cli.sh | 21 +++++++++++++++------ bin/ext/util/execHiveCmd.sh | 6 ++++-- 2 files changed, 19 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/2ddd86de/bin/ext/cli.sh ---------------------------------------------------------------------- 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 http://git-wip-us.apache.org/repos/asf/hive/blob/2ddd86de/bin/ext/util/execHiveCmd.sh ---------------------------------------------------------------------- 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 "$@" }
