Skip to content

Commit

Permalink
HIVE-24210: PartitionManagementTask fails if one of tables dropped af…
Browse files Browse the repository at this point in the history
…ter fetching TableMeta (Naresh P R, reviewed by Vineet Garg)
  • Loading branch information
nareshpr authored Oct 2, 2020
1 parent f002c10 commit d4de3a7
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.common.repl.ReplConst;
import org.apache.hadoop.hive.metastore.api.NoSuchObjectException;
import org.apache.hadoop.hive.metastore.api.Table;
import org.apache.hadoop.hive.metastore.api.TableMeta;
import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
Expand Down Expand Up @@ -127,9 +128,14 @@ public void run() {
dbPattern, tablePattern, foundTableMetas.size());

for (TableMeta tableMeta : foundTableMetas) {
Table table = msc.getTable(tableMeta.getCatName(), tableMeta.getDbName(), tableMeta.getTableName());
if (partitionDiscoveryEnabled(table.getParameters()) && !tblBeingReplicatedInto(table.getParameters())) {
candidateTables.add(table);
try {
Table table = msc.getTable(tableMeta.getCatName(), tableMeta.getDbName(), tableMeta.getTableName());
if (partitionDiscoveryEnabled(table.getParameters()) && !tblBeingReplicatedInto(table.getParameters())) {
candidateTables.add(table);
}
} catch (NoSuchObjectException e) {
// Ignore dropped tables after fetching TableMeta.
LOG.warn(e.getMessage());
}
}
if (candidateTables.isEmpty()) {
Expand Down

0 comments on commit d4de3a7

Please sign in to comment.