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.

sqoop overwite data files ?

sqoop overwite data files ?

Contributor
I imported data from RDBMS to HDFS through sqoop with the following command: 
sqoop import --connect ... --table ... --hive-import --hive-table --m 20 etc.
 
So this command will create 20 files under a dir in hdfs.

If I decide later to import another data and overwrite the existing one I will use the following command: 

sqoop import --connect ... --table ... --hive-import --hive-overwrite --hive-table --m 10.

 

Will Sqoop go to the dir and remove all the previous 20 files and create 10 new ones ?

2 REPLIES 2

Re: sqoop overwite data files ?

Master Collaborator
I think it will throw you an error saying that the destination directory is not empty. At least this is how I remember it. If not, then it will erase the directory definitely.
Highlighted

Re: sqoop overwite data files ?

Contributor

@Tomas79  I had the chance to test it and I noticed that Sqoop removing all the pro-existing files and creates new ones.