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.
Run Code Online (Sandbox Code Playgroud)
如上面的屏幕输出所示,alter table位置在外部表上只运行一次,然后抛出错误.请告诉我如何使alter table location语句起作用.
我找出了错误并修复了它。问题是在创建表的过程中我将其位置设置为 hdfs 上不存在的路径。所以当我试图改变它的位置时,它不允许我这样做。
解决方案:我首先创建表当前指向的目录,然后创建我想要将表指向的目录。然后 alter table location 语句按要求工作。
| 归档时间: |
|
| 查看次数: |
16954 次 |
| 最近记录: |