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.

file diassapears from HDFS after being loaded in Hive Table

file diassapears from HDFS after being loaded in Hive Table

Explorer

Hi 

 

I imported mysql table into HDFS using sqoop which came in as four part files. ( 4maps)

 

Later I created a hive table and gave one of the part file as input path. Data was populated in the table but file disappeared.

 

Is it expected behaviour or I missed something?

 

Regards

1 REPLY 1
Highlighted

Re: file diassapears from HDFS after being loaded in Hive Table

Expert Contributor
There are two types of tables in hive
1) Managed table
2) External table
Managed table moves the input file to /user/hive/warehouse
External table will not move the input file.
The advantage of using external table is it will not delete the data(Just deletes hive table schema). In managed table if you drop the table in hive it deletes table schema as well as data.
Depends on your use case decide what table to use.

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