Check for the presence of presto libraries only when sql commands are used
@@ -112,6 +112,7 @@ if [ ! -f "${PY_INSTANCE_FILE}" ]; then
fi
# find pulsar sql presto distribution location
+check_presto_libraries() {
if [ ! -d "${PRESTO_HOME}" ]; then
BUILT_PRESTO_HOME="${SQL_HOME}/presto-distribution/target/pulsar-presto-distribution"
@@ -122,6 +123,7 @@ if [ ! -d "${PRESTO_HOME}" ]; then
fi
PRESTO_HOME=${BUILT_PRESTO_HOME}
fi
+}
pulsar_help() {
cat <<EOF
@@ -345,8 +347,10 @@ elif [ $COMMAND == "broker-tool" ]; then
elif [ $COMMAND == "compact-topic" ]; then
exec $JAVA $OPTS org.apache.pulsar.compaction.CompactorTool --broker-conf $PULSAR_BROKER_CONF $@
elif [ $COMMAND == "sql" ]; then
+ check_presto_libraries
exec $JAVA -cp "${PRESTO_HOME}/lib/*" com.facebook.presto.cli.Presto --server localhost:8081 "${@}"
elif [ $COMMAND == "sql-worker" ]; then
+ check_presto_libraries
exec ${PRESTO_HOME}/bin/launcher --etc-dir ${PULSAR_PRESTO_CONF} "${@}"
elif [ $COMMAND == "tokens" ]; then
exec $JAVA $OPTS org.apache.pulsar.utils.auth.tokens.TokensCliUtils $@
