SourabhBadhya commented on code in PR #3457:
URL: https://github.com/apache/hive/pull/3457#discussion_r927401945
##########
ql/src/java/org/apache/hadoop/hive/ql/lockmgr/DbTxnManager.java:
##########
@@ -485,6 +480,26 @@ private void clearLocksAndHB() {
stopHeartbeat();
}
+ private void cleanupDirForCTAS() {
+ if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.TXN_CTAS_X_LOCK)) {
+ 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("location",
destinationTable.getSd().getLocation());
+ rqst.putToProperties("ifPurge", Boolean.toString(true));
+ TxnStore txnHandler = TxnUtils.getTxnStore(conf);
+ txnHandler.submitForCleanup(rqst,
destinationTable.getTTable().getWriteId(), getCurrentTxnId());
+ } catch (InterruptedException | IOException | MetaException e) {
+ throw new RuntimeException("Not able to submit cleanup operation of
directory written by CTAS");
Review Comment:
All three exceptions are thrown within the code. Changed it to LockException
instead of RuntimeException.
--
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]