Hive 更改位置语句不起作用 [英] Hive alter location statement not working

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

问题描述

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.

如上面的屏幕输出所示,alter table location 在外部表上只工作一次,随后抛出错误.请建议我如何使更改表位置语句起作用.

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.

推荐答案

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

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.

分辨率:我首先创建了表当前指向的目录,然后创建了我想将表指向的目录.然后,alter table location 语句按要求工作.

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 更改位置语句不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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