Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Can't remove file from HDFS

avatar
Contributor

Hi , 

 

I can't remove file from HDFS

 

hdfs dfs -rm -r /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22

rm: Permission denied: user=hadoop, access=ALL, inode="/user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22":impala:hive:drwxr-xr-x

 

1. i created the table on hive and user : hadoop

drwxrwxrwt   - hadoop hive          0 2018-02-23 18:54 /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248

2, i inserted data to table:dbaa.tablea with impala ,so the folder like below.

drwxr-xr-x   - impala hive          0 2018-02-23 19:33 /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea1519385391248/dt=2018-02-22

 

my question is 

How can i remove the folder:/user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea1519385391248/dt=2018-02-22

 

1. I tried remove it with user:hadoop

hdfs dfs -rm -r /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22

rm: Permission denied: user=hadoop, access=ALL, inode="/user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22":impala:hive:drwxr-xr-x

2. I tried remove it with user:impala

hdfs dfs -rm -r /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22
rm: Permission denied: user=impala, access=EXECUTE, inode="/user/hadoop/.Trash":hadoop:supergroup:drwx-w----

 

 

 

1 ACCEPTED SOLUTION

avatar
Super Collaborator

You have a mixed up situation.

Try as user "hdfs" (the superuser of hdfs) and also add -skipTrash in your command.

View solution in original post

2 REPLIES 2

avatar
Super Collaborator

You have a mixed up situation.

Try as user "hdfs" (the superuser of hdfs) and also add -skipTrash in your command.

avatar
Contributor

Yes, 

 

As your said, i removed the file by user'hdfs.