tarak271 commented on code in PR #4859:
URL: https://github.com/apache/hive/pull/4859#discussion_r1414038396


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/storage/compact/AlterTableCompactOperation.java:
##########
@@ -80,15 +84,15 @@ public AlterTableCompactOperation(DDLOperationContext 
context, AlterTableCompact
       Optional<String> partitionName =  
partitionMap.keySet().stream().findFirst();
       partitionName.ifPresent(compactionRequest::setPartitionname);
     }
-    List<CompactionResponse> compactionResponses =
+    Map<CompactionResponse, String> compactionResponses =
         initiatorBase.initiateCompactionForTable(compactionRequest, 
table.getTTable(), partitionMap);
-    for (CompactionResponse compactionResponse : compactionResponses) {
+    for (Map.Entry<CompactionResponse, String> compactionResponseEntry : 
compactionResponses.entrySet()) {
+      CompactionResponse compactionResponse = compactionResponseEntry.getKey();
       if (!compactionResponse.isAccepted()) {
-        String message;
         if (compactionResponse.isSetErrormessage()) {
-          message = compactionResponse.getErrormessage();
           throw new HiveException(ErrorMsg.COMPACTION_REFUSED, 
table.getDbName(), table.getTableName(),
-              "CompactionId: " + compactionResponse.getId(), message);
+              compactionResponseEntry.getValue() == null ? "" :
+                  "(partition=" + compactionResponseEntry.getValue() + ")", 
compactionResponse.getErrormessage());

Review Comment:
   Added new test case



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