diff --git a/bin/ext/util/execHiveCmd.sh b/bin/ext/util/execHiveCmd.sh index e46ec3c..4a87e25 100644 --- a/bin/ext/util/execHiveCmd.sh +++ b/bin/ext/util/execHiveCmd.sh @@ -13,15 +13,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +CLI_JAR="hive-cli-*.jar" +BEELINE_JAR="hive-beeline-*.jar" + execHiveCmd () { CLASS=$1; shift; - JAR=$1 - shift; + + # if jar is not passed as parameter use corresponding cli jar + if [ $1 == $CLI_JAR ] || [ $1 == $BEELINE_JAR ]; then + JAR=$1 + shift; + else + if [ $USE_DEPRECATED_CLI == "true" ]; then + JAR=$CLI_JAR + else + JAR=$BEELINE_JAR + fi + fi # cli specific code if [ ! -f ${HIVE_LIB}/$JAR ]; then - echo "Missing Hive CLI Jar" + echo "Missing $JAR Jar" exit 3; fi