diff --git a/bin/ext/beeline.sh b/bin/ext/beeline.sh index 8052c452ba..8cd3388e1a 100644 --- a/bin/ext/beeline.sh +++ b/bin/ext/beeline.sh @@ -32,7 +32,11 @@ beeline () { export HADOOP_CLASSPATH="${hadoopClasspath}${HIVE_CONF_DIR}:${beelineJarPath}:${superCsvJarPath}:${jlineJarPath}" export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=beeline-log4j2.properties " - exec $HADOOP jar ${beelineJarPath} $CLASS $HIVE_OPTS "$@" + if [ $CLIUSER!="" ] ; then + exec $HADOOP jar ${beelineJarPath} $CLASS $HIVE_OPTS -n "${CLIUSER}" -p "${CLIUSER}" "$@" + else + exec $HADOOP jar ${beelineJarPath} $CLASS $HIVE_OPTS "$@" + fi } beeline_help () { diff --git a/bin/hive b/bin/hive index a7ae2f571e..ef9ef955d2 100755 --- a/bin/hive +++ b/bin/hive @@ -86,6 +86,7 @@ if [ "$SERVICE" = "" ] ; then fi if [[ "$SERVICE" == "cli" && "$USE_BEELINE_FOR_HIVE_CLI" == "true" ]] ; then + CLIUSER=`whoami` SERVICE="beeline" fi