use of org.apache.hadoop.hive.ql.ddl.table.constraint.drop.AlterTableDropConstraintDesc in project hive by apache.
the class DropConstraintHandler method handle.
@Override
public List<Task<?>> handle(Context context) throws SemanticException {
DropConstraintMessage msg = deserializer.getDropConstraintMessage(context.dmd.getPayload());
final String actualDbName = context.isDbNameEmpty() ? msg.getDB() : context.dbName;
final String actualTblName = msg.getTable();
final TableName tName = HiveTableName.ofNullable(actualTblName, actualDbName);
String constraintName = msg.getConstraint();
AlterTableDropConstraintDesc dropConstraintsDesc = new AlterTableDropConstraintDesc(tName, context.eventOnlyReplicationSpec(), constraintName);
Task<DDLWork> dropConstraintsTask = TaskFactory.get(new DDLWork(readEntitySet, writeEntitySet, dropConstraintsDesc, true, context.getDumpDirectory(), context.getMetricCollector()), context.hiveConf);
context.log.debug("Added drop constrain task : {}:{}", dropConstraintsTask.getId(), actualTblName);
updatedMetadata.set(context.dmd.getEventTo().toString(), actualDbName, actualTblName, null);
return Collections.singletonList(dropConstraintsTask);
}
Aggregations