hdinsight配置单元,msck修复表\u名称抛出错误

yebdmbv4  于 2021-06-28  发布在  Hive
关注(0)|答案(1)|浏览(421)

我有一个名为employee的外部分区表,带有分区(年、月、日),每天都有一个新文件出现,并在特定的日期位置调用今天的日期,它将在2016/10/13。

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

所以每天我们都需要运行命令,它可以正常工作

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

但是一旦我们因为不想手动执行上面的altertable命令而尝试使用below命令,它就会抛出below错误

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

注:

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

请帮助我,因为我坚持这个。我们有解决这种情况的办法吗?

blpfk2vs

blpfk2vs1#

我找到了一个解决问题的解决方案,如果表静态分区名类似于'year=2016/month=10/day=13',那么我们可以使用下面的命令,它正在工作。。。

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

相关问题