deniskuzZ commented on code in PR #3608:
URL: https://github.com/apache/hive/pull/3608#discussion_r1000759228


##########
ql/src/java/org/apache/hadoop/hive/ql/ddl/process/show/compactions/ShowCompactionsOperation.java:
##########
@@ -68,6 +76,37 @@ public int execute() throws HiveException {
     return 0;
   }
 
+  private ShowCompactRequest getShowCompactioRequest(ShowCompactionsDesc desc) 
throws MetaException, SemanticException {
+    ShowCompactRequest request = new ShowCompactRequest();
+    if (isBlank(desc.getDbName() )&& isNotBlank(desc.getTbName())) {
+      request.setDbname(SessionState.get().getCurrentDatabase());
+    } else {
+      request.setDbname(desc.getDbName());
+    }
+    if (isNotBlank(desc.getTbName()))
+      request.setTablename(desc.getTbName());
+    if (isNotBlank(desc.getPoolName()))
+      request.setPoolName(desc.getPoolName());
+    if (isNotBlank(desc.getCompactionType()))
+      
request.setType(TxnUtils.inputCompactionType2DBType(desc.getCompactionType()));
+    if (isNotBlank(desc.getCompactionStatus()))
+      
request.setState(TxnUtils.compactorStateFromInput(desc.getCompactionStatus()));
+    if (isNotEmpty(desc.getPartSpec()))
+      request.setPartitionname(getPartitionName(desc.getPartSpec()));
+    return request;
+  }
+
+  private String getPartitionName(Map<String, String> partitionSpec) throws 
SemanticException {

Review Comment:
   same method exists in AlterTableUpdateColumnStatistictAnalyzer, could we 
move it to utils class?



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