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


##########
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java:
##########
@@ -485,6 +493,27 @@ private void clearLocksAndHB() {
     stopHeartbeat();
   }
 
+  private void cleanupOutputDir(Context ctx) throws MetaException {
+    if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.TXN_CTAS_X_LOCK)) {
+      Table destinationTable = ctx.getDestinationTable();
+      if (destinationTable != null) {
+        try {
+          CompactionRequest rqst = new CompactionRequest(
+                  destinationTable.getDbName(), 
destinationTable.getTableName(), CompactionType.MAJOR);
+          
rqst.setRunas(TxnUtils.findUserToRunAs(destinationTable.getSd().getLocation(),
+                  destinationTable.getTTable(), conf));
+
+          rqst.putToProperties(META_TABLE_LOCATION, 
destinationTable.getSd().getLocation());
+          rqst.putToProperties(IF_PURGE, Boolean.toString(true));
+          TxnStore txnHandler = TxnUtils.getTxnStore(conf);

Review Comment:
   btw, would it be hard to create a completionHook similar to Iceberg one?



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