hive加载数据权限报错

淩亂°似流年 2023-02-16 09:27 168阅读 0赞

前提
上传数据至hdfs 的/user/root/下,创建了hive的orc表,准备load数据,创建了临时的ordertmp的textfile格式表,后面用insert overwrite进目标表。

执行load data 从/user/root/下加载数据到hive表中,报下面的权限错误。

  1. 0: jdbc:hive2://node01:10000> load data inpath '/user/root/order/order.txt' into table ordertmp;
  2. INFO : Compiling command(queryId=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36): load data inpath '/user/root/order/order.txt' into table ordertmp
  3. INFO : Semantic Analysis Completed
  4. INFO : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
  5. INFO : Completed compiling command(queryId=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36); Time taken: 0.471 seconds
  6. INFO : Executing command(queryId=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36): load data inpath '/user/root/order/order.txt' into table ordertmp
  7. INFO : Starting task [Stage-0:MOVE] in serial mode
  8. INFO : Loading data to table default.ordertmp from hdfs://node01:8020/user/root/order/order.txt
  9. ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. org.apache.hadoop.hive.ql.metadata.HiveException: Access denied: Unable to move source hdfs://node01:8020/user/root/order/order.txt to destination hdfs://node01:8020/user/hive/warehouse/ordertmp: Permission denied: user=anonymous, access=WRITE, inode="/user/root/order":root:supergroup:drwxr-xr-x
  10. INFO : Completed executing command(queryId=hive_20200609152526_ab09ff14-54cf-4e3c-ac05-a47f82389b36); Time taken: 0.289 seconds
  11. Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask. org.apache.hadoop.hive.ql.metadata.HiveException: Access denied: Unable to move source hdfs://node01:8020/user/root/order/order.txt to destination hdfs://node01:8020/user/hive/warehouse/ordertmp: Permission denied: user=anonymous, access=WRITE, inode="/user/root/order":root:supergroup:drwxr-xr-x (state=08S01,code=1)

解决:

  1. su hdfs
  2. hdfs dfs -chmod -R 777 /user/root/

解决。

发表评论

表情:
评论列表 (有 0 条评论,168人围观)

还没有评论,来说两句吧...

相关阅读