diff --git a/bin/beeline b/bin/beeline index 7b974d4..d247c39 100644 --- a/bin/beeline +++ b/bin/beeline @@ -18,9 +18,4 @@ bin=`dirname "$0"` bin=`cd "$bin"; pwd` -# If process is backgrounded, don't change terminal settings -if [[ ( ! $(ps -o stat= -p $$) =~ "+" ) && ! ( -p /dev/stdin ) ]]; then - export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Djline.terminal=jline.UnsupportedTerminal" -fi - . "$bin"/hive --service beeline "$@" diff --git a/bin/ext/cli.sh b/bin/ext/cli.sh index 4933c2e..87329f3 100644 --- a/bin/ext/cli.sh +++ b/bin/ext/cli.sh @@ -22,13 +22,6 @@ if [ -z "$USE_DEPRECATED_CLI" ] || [ "$USE_DEPRECATED_CLI" != "false" ]; then USE_DEPRECATED_CLI="true" fi -updateBeelineOpts() { - # If process is backgrounded, don't change terminal settings - if [[ ( ! $(ps -o stat= -p $$) =~ *+ ) && ! ( -p /dev/stdin ) ]]; then - export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Djline.terminal=jline.UnsupportedTerminal" - fi -} - updateCli() { if [ "$USE_DEPRECATED_CLI" == "true" ]; then CLASS=org.apache.hadoop.hive.cli.CliDriver @@ -37,7 +30,6 @@ updateCli() { export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=beeline-log4j2.properties" CLASS=org.apache.hive.beeline.cli.HiveCli JAR=hive-beeline-*.jar - updateBeelineOpts fi } diff --git a/bin/hive b/bin/hive index 50fbddd..e1ee206 100755 --- a/bin/hive +++ b/bin/hive @@ -344,6 +344,13 @@ else export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Dlog4j.configurationFile=hive-log4j2.properties -Djava.util.logging.config.file=$bin/../conf/parquet-logging.properties " fi +if [[ "$SERVICE" =~ ^(hiveserver2|beeline|cli)$ ]] ; then + # If process is backgrounded, don't change terminal settings + if [[ ( ! $(ps -o stat= -p $$) =~ "+" ) && ! ( -p /dev/stdin ) ]]; then + export HADOOP_CLIENT_OPTS="$HADOOP_CLIENT_OPTS -Djline.terminal=jline.UnsupportedTerminal" + fi +fi + if [ "$TORUN" = "" ] ; then echo "Service $SERVICE not found" echo "Available Services: $SERVICE_LIST"