Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

The Directory in HDFS goes in Trash when i drop a external table from hive.

Solved Go to solution

The Directory in HDFS goes in Trash when i drop a external table from hive.

Contributor

Hi All,

I copy the file from local to HDFS in " /data/folder1/file.gz" directory.

then i have created a external table "abc" using the same file location.

When i use command "drop table abc;" its drops the table and also the "folder1/file.gz" from HDFS.

Checked : No background process, no script, nothing running.

found the same in HDFS dir "/user/hiveuser/.Trash/Current/data/folder1/file.gz".

1 ACCEPTED SOLUTION

Accepted Solutions

Re: The Directory in HDFS goes in Trash when i drop a external table from hive.

Super Guru
@Rohit Sharma

Can you please try creating table on your /data/folder1 table instead of the file?

2 REPLIES 2

Re: The Directory in HDFS goes in Trash when i drop a external table from hive.

Super Guru
@Rohit Sharma

Can you please try creating table on your /data/folder1 table instead of the file?

Re: The Directory in HDFS goes in Trash when i drop a external table from hive.

Hi @Rohit Sharma. Did you use the 'EXTERNAL' keyword when you created the table? If you don't specify 'EXTERNAL' then it is an internal table and the data will be deleted, regardless of what location you specify for the data...

Don't have an account?
Coming from Hortonworks? Activate your account here