belugabehr commented on a change in pull request #2274: URL: https://github.com/apache/hive/pull/2274#discussion_r637098230
########## File path: standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/CompactionTxnHandler.java ########## @@ -365,7 +365,29 @@ public void markCleaned(CompactionInfo info) throws MetaException { ResultSet rs = null; try { dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED); - String s = "INSERT INTO \"COMPLETED_COMPACTIONS\"(\"CC_ID\", \"CC_DATABASE\", " + + // Get all of this partition's COMPACTION_QUEUE entries in "ready for cleaning" with smaller id. + // TODO eventually change this to CQ_NEXT_TXN_ID (it might be null for some entires) + String s = "SELECT \"CQ_ID\" FROM \"COMPACTION_QUEUE\" WHERE \"CQ_DATABASE\"=? AND \"CQ_TABLE\"=? "; + if (info.partName != null) { + s += " AND \"CQ_PARTITION\" = ?"; + } + s += " AND \"CQ_STATE\"='" + READY_FOR_CLEANING + "' AND \"CQ_ID\" <= " + info.id; + pStmt = dbConn.prepareStatement(s); + pStmt.setString(1, info.dbname); + pStmt.setString(2, info.tableName); + if (info.partName != null) { + pStmt.setString(3, info.partName); + } + LOG.debug("Going to execute query <" + s + "> for CQ_ID=" + info.id); Review comment: `LOG.debug("Going to execute query <{}> for CQ_ID={}", s, info.id);` -- 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