hsnusonic commented on a change in pull request #2073:
URL: https://github.com/apache/hive/pull/2073#discussion_r600171856



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java
##########
@@ -3587,6 +3590,81 @@ public ShowCompactResponse 
showCompact(ShowCompactRequest rqst) throws MetaExcep
     }
   }
 
+  @RetrySemantics.ReadOnly
+  public GetLatestCompactionInfoResponse 
getLatestCompactionInfo(GetLatestCompactionInfoRequest rqst)
+      throws MetaException {
+    GetLatestCompactionInfoResponse response = new 
GetLatestCompactionInfoResponse();
+    response.setDbname(rqst.getDbname());
+    response.setTablename(rqst.getTablename());
+    Connection dbConn = null;
+    PreparedStatement pst = null;
+    ResultSet rs = null;
+    try {
+      try {
+        dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
+
+        List<String> params = new ArrayList<>();
+        // This query combines the result sets of succeeded compactions and 
readyToClean compactions
+        StringBuilder sb = new StringBuilder()
+            .append("SELECT * FROM (")
+            .append("   SELECT")
+            .append("   \"CC_ID\", \"CC_DATABASE\", \"CC_TABLE\", 
\"CC_PARTITION\", \"CC_TYPE\"")
+            .append("   FROM \"COMPLETED_COMPACTIONS\"")
+            .append("     WHERE \"CC_STATE\" = " + quoteChar(SUCCEEDED_STATE))

Review comment:
       Added to the description of the method.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to