Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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.