Alan Jackoway created IMPALA-9901:
-------------------------------------

             Summary: Drop Database Deletes Whole Directory
                 Key: IMPALA-9901
                 URL: https://issues.apache.org/jira/browse/IMPALA-9901
             Project: IMPALA
          Issue Type: Bug
    Affects Versions: Impala 2.12.0
            Reporter: Alan Jackoway


When you create a database with a location, it appears that drop database will 
delete the entire directory even if there is other content in it.

An easy way to reproduce this is to create two databases mapped to the same 
location:
{code:java}
$ hadoop fs -mkdir /user/alanj/test_warehouse
impala> create database u_alanj_important location '/user/alanj/test_warehouse';
impala> create table u_alanj_important.important_table(a string); 
impala> create database u_alanj_unimportant location  
'/user/alanj/test_warehouse';
$ hadoop fs -ls /user/alanj/test_warehouse
Found 1 items
drwxrwxr-x   - impala alanj          0 2020-06-26 16:41 
/user/alanj/test_warehouse/important_table

{code}
Then drop the database without any tables in it:
{code:java}
impala> drop database u_alanj_unimportant;
$ hadoop fs -ls /user/alanj/test_warehouse
ls: `/user/alanj/test_warehouse': No such file or directory {code}
I verified that it will behave the same way with a file/directory placed in the 
location by a user as it does with content created there by impala.

Hive does not delete the directory when drop database is called.

Depending on the permissions configuration for your user and the impala user, 
you might be able to use this to delete folders you otherwise couldn't delete.

Set to critical as this can cause you to accidentally delete data without a 
warning, if you configure things in a way that is admittedly questionable.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to