Sqoop creating new file for import evertime

0 votes

I am using the below query to do incremental import and it is creating a new file everytime... like part-m-000 00 is already present and if there are no new records in the table,,, it still creates a new file part-m-00001 and gets all the records again in the file
 

sqoop import --connect jdbc:mysql://mysqldb.edu.cloudlab.com/userDb --username=labuser --password=letmepass -m 1 --table employee
e -target-dir "/user/hduser/user_Test1" --incremental append --check-column id

I assume that if there is no change in the table data then it should not create any new file and if there is a change it should only add new rows.
But in my case, it is importing all the rows again in a new file.
Please let me know if I am doing anything wrong.

Jan 8, 2019 in Big Data Hadoop by slayer
• 29,370 points
1,143 views

1 answer to this question.

0 votes

No, you are not doing anything wrong but unfortunately, that's the way sqoop works. Every time you make any changes in the table and then do incremental append then the new data is saved in a new file.

That's how batch processing works in all hadoop technologies.

If you want to create additional part files with only new records, then you may have to use one more parameter --last-value in the sqoop command. Please refer below command. 

Command: sqoop import --connect jdbc:mysql://mysqldb.edu.cloudlab.com/MonikaDb --username=labuser --password=edureka -m 1 --table employee -target-dir "/user/edureka_425270/Monika_Test1" --incremental append --check-column id --last-value 2 4
answered Jan 8, 2019 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer

How to import data in sqoop as a Parquet file?

Sqoop allows you to import the file ...READ MORE

answered May 15, 2019 in Big Data Hadoop by Nanda
10,998 views
0 votes
1 answer

Creating testjob in sqoop for incremental load

Yes, it is possible to do so. ...READ MORE

answered Jul 5, 2019 in Big Data Hadoop by Umar
977 views
0 votes
1 answer

How Sqoop and Tera Data Connector for Hadoop differ from each other?

In order to make use of TD ...READ MORE

answered May 2, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
1,461 views
0 votes
1 answer

HDFS for customer information file

No, because HDFS is optimized for write-once, ...READ MORE

answered Jul 31, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
609 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,015 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,528 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,740 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,605 views
0 votes
1 answer

Hadoop sqoop import not working. Error: ERROR manager.SqlManager: Error reading from database

In the command, try mentioning the driver ...READ MORE

answered Dec 5, 2018 in Big Data Hadoop by Omkar
• 69,220 points
2,147 views
0 votes
1 answer

How to use sqoop import?

Here is an example of import command. ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 69,220 points
832 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP