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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -3084,17 +3076,26 @@ private boolean drop_table_core(final RawStore ms, 
final String catName, final S
                       this, isReplicated),
                   envContext);
         }
+        if (tableDataShouldBeDeleted) {
+          // Data needs deletion. Check if trash may be skipped.
+          // Delete the data in the partitions which have other locations
+          deletePartitionData(partPaths, ifPurge, 
ReplChangeManager.shouldEnableCm(db, tbl));
+          // Delete the data in the table
+          deleteTableData(tblPath, ifPurge, 
ReplChangeManager.shouldEnableCm(db, tbl));
+        }
         success = ms.commitTransaction();
       }
+    } catch (Exception e) {
+      ms.rollbackTransaction();
+      LOG.error("Failed to drop table " + name + ", rolling back transaction", 
e);
+      if (e instanceof MetaException) {

Review Comment:
   drop this



##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -3216,7 +3217,8 @@ private void deleteDataExcludeCmroot(Path path, boolean 
ifPurge, boolean shouldE
         wh.deleteDir(path, true, ifPurge, shouldEnableCm);
       }
     } catch (Exception e) {
-      LOG.error("Failed to delete directory: {}", path, e);
+      throw new MetaException("Failed to delete directory: " + path.toString() 
+ " . Exception detail : "

Review Comment:
   keep the logger
   throw ExceptionHandler.newMetaException(e)



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