HDINSIGHT配置单元,MSCK修复表table_name抛出错误 [英] HDINSIGHT hive, MSCK REPAIR TABLE table_name throwing error

查看:170
本文介绍了HDINSIGHT配置单元,MSCK修复表table_name抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个名为employee的外部分区表,其分区为(年,月,日),每天都有一个新文件出现在特定日期的位置,并要求今天的日期为2016/10/13. >

i have an external partitioned table named employee with partition(year,month,day), everyday a new file come and seat at the particular day location call for today's date it will be at 2016/10/13.

TABLE SCHEMA:
create External table employee(EMPID Int,FirstName String,.....)
partitioned by (year string,month string,day string)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' LOCATION '/.../emp';

所以每天我们都需要运行正常运行的命令

so everyday we need to run command which is working fine as

ALTER TABLE employee ADD IF NOT EXISTS PARTITION (year=2016,month=10,day=14) LOCATION '/.../emp/2016/10/14';

但是一旦我们尝试使用下面的命令,因为我们不想手动执行上面的alter table命令,它会在错误下面抛出

but once we are trying with below command because we don't want to execute the above alter table command manually, it throws below Error

hive> MSCK REPAIR TABLE employee;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask

注意:

hive> MSCK TABLE employee; //this show me that a partition has not added in the table
OK
Partitions not in metastore: employee:2016/10/14
Time taken: 1.066 seconds, Fetched: 1 row(s)

请坚持帮我.对于这种情况我们有什么解决方法吗?

please help me as i stuck with this. do we have any workaround for this type of situation?

推荐答案

我为我的问题找到了一种解决方法,即,如果表的静态分区名称类似于"year = 2016/month = 10/day = 13",则我们可以使用下面的命令,它正在工作...

I got a workaround solution for my problem which is, if the table static partition name is like 'year=2016/month=10/day=13' then we can use below command and it is working...

set hive.msck.path.validation=ignore;
MSCK REPAIR TABLE table_name;

这篇关于HDINSIGHT配置单元,MSCK修复表table_name抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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