location配置错误,导致hive表无法被操作

来源:互联网 发布:淘宝模特图片拍摄真相 编辑:程序博客网 时间:2024/05/17 06:59

案件背景:

    大数据平台有两个环境,分正式环境和测试环境。创建hive的时候,把正式环境的表的location配置成测试的路径,测试环境的hive表的location配置成正式的路径。这样导致两张hive表无法被操作,truncate、insert、select、drop都不能。


案件错误日志:

    执行命令     drop table mysql4_csp_cstm_terminal;

   报错:FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:java.lang.IllegalArgumentException: Wrong FS: hdfs://xx.xx.xx.xx:8020/user/hive/warehouse/db_ecar.db/mysql4_csp_cstm_terminal, expected: hdfs://masterf:8020)


解决方案:

    将hive表的location修改过来。

   alter table mysql4_csp_cstm_terminal set location 'hdfs://xx.xx.xx.xx:8020/user/hive/warehouse/db_ecar.db/mysql4_csp_cstm_terminal'

阅读全文
0 0
原创粉丝点击