added beeline.sh

pull/2/head
Hari Sekhon 5 years ago
parent 1c0c6b77b2
commit 6f3d0f39cd

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# vim:ts=4:sts=4:sw=4:et
#
# Author: Hari Sekhon
# Date: 2019-12-06 11:10:26 +0000 (Fri, 06 Dec 2019)
#
# https://github.com/harisekhon/bash-tools
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/harisekhon
#
set -euo pipefail
[ -n "${DEBUG:-}" ] && set -x
if [ -z "${HIVESERVER2_HOST:-}" ]; then
echo "HIVESERVER2_HOST environment variable not set"
exit 3
fi
ssl=""
if [ -n "${HIVESERVER2_SSL:-}" ]; then
ssl=";ssl=true"
fi
beeline -u "jdbc:hive2://$HIVESERVER2_HOST:10000/default;principal=hive/$HIVESERVER2_HOST@${HIVESERVER2_HOST#*.}$ssl"
Loading…
Cancel
Save