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,040 points
20 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,850 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
14 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
• 9,070 points
25 views
0 votes
1 answer

How should I provide a URL for hdfs file system?

If you are trying to access your ...READ MORE

answered Sep 10, 2018 in Big Data Hadoop by Frankie
• 9,590 points
61 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
• 9,070 points
1,679 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
• 9,070 points
132 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
8,164 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
573 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
• 65,850 points
118 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
• 65,850 points
56 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.