sql - 配置单元查询错误

标签 sql hadoop hive

我想更新一个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/

相关文章:

sql - 带有 select_all 的 Rails 准备好的语句

postgresql - 从 10 亿行 GreenPlum DB 中缓慢选择

hadoop - Oozie Hive在AWS上的行动-不可预测的IP源破坏了工作

java - 从 HIVE UDF 读取 HDFS 文件 - 执行错误,返回代码 101 FunctionTask。无法初始化类

mysql - 有两个条件的 INSERT INTO 或 UPDATE

mysql - 复杂派生表的 SUM

hadoop - beeline的用户名和密码是什么

hadoop - Cube.js 作为报告工具

sql - Hive 和选择不匹配的记录

sql - 过滤 SQL 行