zxl-333 commented on code in PR #5975:
URL: https://github.com/apache/hive/pull/5975#discussion_r2209859237
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:
##########
@@ -3047,7 +3047,8 @@ 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());
- if (!wh.isWritable(tblPath.getParent())) {
+ // HIVE-28804 drop table user should have table path and parent path
permission
Review Comment:
> oh, ok. so you need to propagate the exception back to client? why add
check for parent dir? Btw, since it's a managed table, the 'test_drop' table
should have been created by the Hive user, not the HDFS user.
>
> why do you even create a MANAGED table? just use EXTERNAL
The "manage" table can not only be for Hive users, but also for other users
on the cluster. If there is no permission to write in the parent directory,
then even if the current directory has write permission, the deletion operation
cannot be completed successfully. Below is what I tested through the HDFS
command.
**parent direct:**
drwxr-xr-x - hdfs hadoop 0 2025-07-16 17:48 /tmp/test_drop
**child direct:**
drwxrwxrwx - hdfs hadoop 0 2025-07-16 17:48 /tmp/test_drop/t1
use hive user delete direct
hdfs dfs -rm -r -f /tmp/test_drop/t1
rm: **Failed** to move to trash: hdfs://ns1/tmp/test_drop/t1: Permission
denied: user=hive, access=WRITE, inode="/tmp/test_drop":hdfs:hadoop:drwxr-xr-x
--
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]