背景

在使用impala往表的新分区写数据时报错

NoSuchMethodError: org.apache.hadoop.hive.metastore.MetaStoreUtils.updatePartitionStatsFast(Lorg/apache/hadoop/hive/metastore/api/Partition;Lorg/apache/hadoop/hive/metastore/Warehouse;)Z

原因

impala与hive版本问题。应该是impala解析SQL的时候用到的是上面这个函数,而HIVE本身解析的时候用的不是该函数且该版本hive没有该函数,导致impala找不到执行函数,发生报错。

方案

之前都是用HIVE写入新分区

insert overwrite xxx.xxx partition(xxx = '20190109')

这样会自动创建20190109的分区目录,然后把数据写入进去,但是impala不能这样操作,需要先新建分区,再插入数据

alter xxx.xxx add partition(xxx = '20190109')
insert overwrite xxx.xxx partition(xxx = '20190109')
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐