if (old_index != null) {
throw new AlreadyExistsException("Index already exists:" + index);
}
Table origTbl = ms.getTable(index.getDbName(), index.getOrigTableName());
if (origTbl == null) {
throw new InvalidObjectException(
"Unable to add index because database or the orginal table do not exist");
}
// set create time
long time = System.currentTimeMillis() / 1000;
Table indexTbl = indexTable;
if (indexTbl != null) {
try {
indexTbl = ms.getTable(index.getDbName(), index.getIndexTableName());
} catch (Exception e) {
}
if (indexTbl != null) {
throw new InvalidObjectException(
"Unable to add index because index table already exists");
}
this.create_table(indexTable);
indexTableCreated = true;
}