Hive alter location语句不起作用 [英] Hive alter location statement not working

查看:803
本文介绍了Hive alter location语句不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 蜂房> alter table my_table_name设置位置hdfs:// nameservice1 / foo; 
确定
所需时间:0.173秒
配置单元> alter table my_table_name设置位置hdfs:// nameservice1 / foo / bar;
授权失败:org.apache.hadoop.security.AccessControlException:操作在用户hadoop_user的路径hdfs:// nameservice1 / foo上不允许写入WRITE。使用show grant获取更多详细信息。

如上面的屏幕输出所示,alter table位置在外部表格上正好工作一次,随后它会抛出一个错误。
请指导我如何让alter table location语句正常工作。

解决方案

我找出错误并修复它。
问题是,在创建表的过程中,我将其位置设置为hdfs上不存在的路径。所以当我试图改变它的位置时,它不允许我这样做。



决议:
我首先创建了目录表当前指向,然后创建我想要将表指向的目录。然后,alter table位置语句按需要工作。

hive> alter table my_table_name set location "hdfs://nameservice1/foo";
OK
Time taken: 0.173 seconds
hive> alter table my_table_name set location "hdfs://nameservice1/foo/bar";
Authorization failed:org.apache.hadoop.security.AccessControlException: action WRITE not permitted on path hdfs://nameservice1/foo for user hadoop_user. Use show grant to get more details.

As seen in the above screen output, the alter table location is working exactly once on the external table and subsequently it is throwing an error. Please advice how I could get the alter table location statement to work.

解决方案

I figured out the error and fixed it. The issue was that during the creation of the table i set its location to a non existent path on hdfs. So when i was trying to alter its location,it wasn't allowing me to do so.

The resolution: I first created the directory to which the table was currently pointed to and then created the directory to which i wanted to point the table to. Then the alter table location statement worked as required.

这篇关于Hive alter location语句不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆