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


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -3047,11 +3047,17 @@ private boolean drop_table_core(final RawStore ms, 
final String catName, final S
       tableDataShouldBeDeleted = checkTableDataShouldBeDeleted(tbl, 
deleteData);
       if (tableDataShouldBeDeleted && tbl.getSd().getLocation() != null) {
         tblPath = new Path(tbl.getSd().getLocation());
+       // HIVE-28804 drop table user should have table path and parent path 
permission
         if (!wh.isWritable(tblPath.getParent())) {
           String target = indexName == null ? "Table" : "Index table";
           throw new MetaException(target + " metadata not deleted since " +
               tblPath.getParent() + " is not writable by " +
               SecurityUtils.getUser());
+        } else if (!wh.isWritable(tblPath)) {
+          String target = indexName == null ? "Table" : "Index table";

Review Comment:
   @zxl-333, can you extract  the `target` out from the if block and use String 
template
   ````
   throw new MetaException(
     STR."\{target} metadata not deleted since \{tblPath} is not writable by 
\{SecurityUtils.getUser()}")
   ````



-- 
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: gitbox-unsubscr...@hive.apache.org

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

Reply via email to