saihemanth-cloudera commented on a change in pull request #2665:
URL: https://github.com/apache/hive/pull/2665#discussion_r718698639



##########
File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/constraint/drop/AlterTableDropConstraintAnalyzer.java
##########
@@ -47,11 +51,18 @@ protected void analyzeCommand(TableName tableName, 
Map<String, String> partition
     String constraintName = unescapeIdentifier(command.getChild(0).getText());
 
     AlterTableDropConstraintDesc desc = new 
AlterTableDropConstraintDesc(tableName, null, constraintName);
-    rootTasks.add(TaskFactory.get(new DDLWork(getInputs(), getOutputs(), 
desc)));
 
     Table table = getTable(tableName);
+    WriteEntity.WriteType writeType = null;
     if (AcidUtils.isTransactionalTable(table)) {
       setAcidDdlDesc(desc);
+      writeType = WriteType.DDL_EXCLUSIVE;
+    } else {
+      writeType = 
WriteEntity.determineAlterTableWriteType(AlterTableType.DROP_CONSTRAINT);
     }
+    inputs.add(new ReadEntity(table));

Review comment:
       AlterTableDropConstraintDesc doesn't extend 
AbstractAlterTableWithConstraintsDesc as is the case with 
AlterTableAddConstraintDesc, So it cannot convert the descriptor object to add 
inputs and outputs. The reason why  AlterTableDropConstraintDesc cannot extend 
AbstractAlterTableWithConstraintsDesc is that the input command only issues the 
constraint name (ALTER TABLE foo DROP CONSTRAINT foo_constraint) but not the 
constraint object (which is the case with ADD constraint) and 
AbstractAlterTableWithConstraintsDesc takes constraint as an argument. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to