deniskuzZ commented on code in PR #6397:
URL: https://github.com/apache/hive/pull/6397#discussion_r3023799998
##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java:
##########
@@ -126,6 +129,24 @@ private List<Path> removeFiles(CleanupRequest cr)
deleted.add(dead);
}
}
+ removeDatabaseDirIfNecessary(db, cr, fs);
return deleted;
}
+
+ private void removeDatabaseDirIfNecessary(Database db, CleanupRequest cr,
FileSystem fs) throws IOException {
+ if (db != null || !cr.isSoftDelete()) {
+ return;
+ }
+ Path databasePath = new Path(cr.getLocation()).getParent();
+ for (FileStatus status : fs.listStatus(databasePath)) {
+ if (status.isDirectory() &&
+ status.getPath().getName().matches("(.*)" +
AcidConstants.SOFT_DELETE_TABLE_PATTERN)) {
Review Comment:
could you please explain this check? can't we simply by listing the dir
count?
--
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]