无法在oozie中从shell操作运行hive,有人能帮我解决这个问题吗

w7t8yxp5  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(388)

这是我的工作流程和错误日志。shell文件内容:


# !/bin/bash

echo
echo
echo "testing"
echo

export HIVE_CONF_DIR=
echo "hive job got started"
cd /opt/mapr/hive/hive-2.1/bin
echo /cygdrive/c/Projects/JLR/embedded_software/main_unit/arm
hive -e "use ozzie_test; create table if not exists test_edh1(name string, id int);"
result=0
if [  -ne 0 ]; then
  echo "Hive error number is: "
  exit 1
else
  echo "hive job got completed successfully"
fi

错误消息:

getting the errorcode  as 127 
Hive error number is: 127

./testScript.sh: line 11: cd: /opt/mapr/hive/hive-2.1/bin: No such file or directory
./testScript.sh: line 13:**hive: command not found**
pieyvz9o

pieyvz9o1#

这个'/opt/mapr/hive/hive-2.1/bin'是hdfs路径吗?如果是,您正试图在hdfs路径上使用'cd'命令,而shell将在本地目录中检查该路径,因此出现错误。

相关问题