try {
db.alterTable(tblName, tbl);
} catch (InvalidOperationException e) {
throw new HiveException("Uable to update table");
}
work.getInputs().add(new ReadEntity(tbl));
work.getOutputs().add(new WriteEntity(tbl));
} else {
Partition part = db.getPartition(tbl, touchDesc.getPartSpec(), false);
if (part == null) {
throw new HiveException("Specified partition does not exist");
}
try {
db.alterPartition(tblName, part);
} catch (InvalidOperationException e) {
throw new HiveException(e);
}
work.getInputs().add(new ReadEntity(part));
work.getOutputs().add(new WriteEntity(part));
}
return 0;
}