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 in Big Data Hadoop by slayer
• 29,170 points
105 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 by Omkar
• 67,660 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 in Big Data Hadoop by Nanda
601 views
0 votes
1 answer

Creating testjob in sqoop for incremental load

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

answered Jul 5 in Big Data Hadoop by Umar
35 views
0 votes
1 answer
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
• 10,710 points
34 views
0 votes
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
• 10,710 points
3,309 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
• 10,710 points
392 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
16,305 views
0 votes
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,260 points
1,188 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
• 67,660 points
253 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
• 67,660 points
89 views