HDINSIGHT hive, MSCK REPAIR TABLE table_name throwing error

不羁岁月 提交于 2020-01-11 20:24:20

问题


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';

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

Note:

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?


回答1:


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;


来源:https://stackoverflow.com/questions/40043986/hdinsight-hive-msck-repair-table-table-name-throwing-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!