【发布时间】:2019-05-23 01:44:00
【问题描述】:
我正在尝试通过查询将数据从 hdfs 目录中的文件插入到 hive 表中:
$ jdbc:hive2://localhost:10000> LOAD DATA INPATH '/user/xyz/stdfiles/testtbl.txt' OVERWRITE INTO TABLE testdb.testtbl;
但查询失败导致:
错误:编译语句时出错:失败: HiveAuthzPluginException 获取权限时出错 hdfs://localhost:9000/user/xyz/stdfiles/testtbl.txt: null (状态=42000,代码=40000)
我已尝试通过以下命令授予权限,但没有错误:
$ hdfs dfs -chown -R stdfiles /user/xyz/stdfiles
$ hdfs dfs -chmod -R 777 /user/xyz/stdfiles/testtbl.txt
已检查:
$ hdfs dfs -ls /user/xyz/stdfiles
19/05/22 09:15:13 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Found 1 items
-rwxrwxrwx 1 stdfiles supergroup 6 2019-05-22 08:45 /user/xyz/stdfiles/testtbl.txt
通过期望的输出成功插入数据
【问题讨论】: