我想更新一个metastore表,并且我有一个.sh与:hive
load data inpath '/user/cloudera/Divisas/Barril_Brent.csv;
但是,当终端执行配置单元时,不要接受下一条将更新表数据的指令
我曾想到过这样的事情:hive -e 'load data inpath '/user/cloudera/Divisas/Barril_Brent.csv' overwrite into table BarrilBrent';
但是不起作用,因为只能捕获 hive ,并且进入命令行程序
最佳答案
确保文件存在于指定的hdfs
位置(/user/cloudera/Divisas/Barril_Brent.csv
)。
如果文件在linux / unix文件系统中,则在local
关键字之前添加inpath
关键字(就像local inpath
一样)
#!/bin/sh
echo "Executing the hive query - starts"
hive -e "load data inpath '/user/cloudera/Divisas/Barril_Brent.csv' into overwrite into table BarrilBrent"
echo "Executing the hive query - ends"
关于sql - 配置单元查询错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36607256/