I am trying to submit spark-submit but its failing with as weird message.
Error: Could not find or load main class org.apache.spark.launcher.Main
/opt/spark/bin/spark-class: line 96: CMD: bad array subscript
this is the first time I am seeing this kind of error. I tried to check the code for the spark-class file but unable to decipher what is causing the issue.
# Turn off posix mode since it does not allow process substitution
set +o posix
CMD=()
DELIM=$'\n'
CMD_START_FLAG="false"
while IFS= read -d "$DELIM" -r ARG; do
if [ "$CMD_START_FLAG" == "true" ]; then
CMD+=("$ARG")
else
if [ "$ARG" == $'\0' ]; then
# After NULL character is consumed, change the delimiter and consume command string.
DELIM=''
CMD_START_FLAG="true"
elif [ "$ARG" != "" ]; then
echo "$ARG"
fi
fi
done < <(build_command "$@")
COUNT=${#CMD[@]}
LAST=$((COUNT - 1))
LAUNCHER_EXIT_CODE=${CMD[$LAST]}
the line which is mentioned in the error message is
LAUNCHER_EXIT_CODE=${CMD[$LAST]}
Any pointer or any idea why the issue will help me a lot.
Thanks