@Override
  public void onAlterTable(AlterTableEvent tableEvent) throws MetaException {
    if (!TxnUtils.isTransactionalTable(tableEvent.getNewTable())) {
      return;
    }
    Table oldTable = tableEvent.getOldTable();
    Table newTable = tableEvent.getNewTable();
    if (!oldTable.getCatName().equalsIgnoreCase(newTable.getCatName()) ||
        !oldTable.getDbName().equalsIgnoreCase(newTable.getDbName()) ||
        !oldTable.getTableName().equalsIgnoreCase(newTable.getTableName())) {
      txnHandler = getTxnHandler();
      txnHandler.onRename(
          oldTable.getCatName(), oldTable.getDbName(), oldTable.getTableName(), null,
          newTable.getCatName(), newTable.getDbName(), newTable.getTableName(), null);
    }
  }
It handles cleanup of dropped partition/table/database in ACID related metastore tables
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java