dengzhhu653 commented on code in PR #2731:
URL: https://github.com/apache/hive/pull/2731#discussion_r926347947


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/compact/AlterTableCompactAnalyzer.java:
##########
@@ -67,6 +73,17 @@ protected void analyzeCommand(TableName tableName, 
Map<String, String> partition
     }
 
     AlterTableCompactDesc desc = new AlterTableCompactDesc(tableName, 
partitionSpec, type, isBlocking, mapProp);
+    Table table = getTable(tableName);
+    WriteEntity.WriteType writeType = null;
+    if (AcidUtils.isTransactionalTable(table)) {
+      setAcidDdlDesc(desc);
+      writeType = WriteType.DDL_EXCLUSIVE;
+    } else {
+      writeType = 
WriteEntity.determineAlterTableWriteType(AlterTableType.COMPACT);
+    }
+    inputs.add(new ReadEntity(table));

Review Comment:
   should we take care of `partitionSpec` as well?



##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/concatenate/AlterTableConcatenateAnalyzer.java:
##########
@@ -95,10 +97,14 @@ protected void analyzeCommand(TableName tableName, 
Map<String, String> partition
     }
   }
 
-  private void compactAcidTable(TableName tableName, Map<String, String> 
partitionSpec) throws SemanticException {
+  private void compactAcidTable(TableName tableName, Table table, Map<String, 
String> partitionSpec) throws SemanticException {
     boolean isBlocking = !HiveConf.getBoolVar(conf, 
ConfVars.TRANSACTIONAL_CONCATENATE_NOBLOCK, false);
 
     AlterTableCompactDesc desc = new AlterTableCompactDesc(tableName, 
partitionSpec, "MAJOR", isBlocking, null);
+    WriteEntity.WriteType writeType = WriteEntity.WriteType.DDL_EXCLUSIVE;

Review Comment:
   should we take care of `partitionSpec` as well?



##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/compact/AlterTableCompactAnalyzer.java:
##########
@@ -67,6 +73,17 @@ protected void analyzeCommand(TableName tableName, 
Map<String, String> partition
     }
 
     AlterTableCompactDesc desc = new AlterTableCompactDesc(tableName, 
partitionSpec, type, isBlocking, mapProp);
+    Table table = getTable(tableName);
+    WriteEntity.WriteType writeType = null;
+    if (AcidUtils.isTransactionalTable(table)) {
+      setAcidDdlDesc(desc);
+      writeType = WriteType.DDL_EXCLUSIVE;

Review Comment:
   cloud you please explain a little bit why we choose DDL_EXCLUSIVE for 
transactional table?  does it works the same for insert only tables?



-- 
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