- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Getting Duplicate records in MySQL database
- Labels:
-
Apache NiFi
Created on ‎03-07-2018 11:54 AM - edited ‎08-18-2019 03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to copy the data from one database(MySQL) to another database(MySQL). Below is the flow.
GenerateTableFetch Partition Size : 1500 records. Total 3200 records so it's creating 3 files as shown in the picture.
I'm able to read the data from the source database(avro format) and convert the data to json(using AvrotoJSON processor). Now I'm trying to load the JSON data into MySQL table using ConvertJSONTOSQL Pricessor. In the source table I have 3200
records, however in my destination table I'm getting 10000+ records. I didn't get where I did mis configuration so that it's inserting duplicate records into destination table. Below are screenshots of the individual processors.
Any suggestions please.
Created on ‎03-07-2018 12:15 PM - edited ‎08-18-2019 03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to autoterminate original relationship in ConvertJSONtoSQL processor, now original relationship is loop back into same processor again which is causing all the duplicates in mysql database.
How to Autoterminate original relationship:-
- clear the queue first.
- delete the original relationship
- right click on processor
- goto setting tab
- click on checkbox at original relationship as shown in the below screenshot
.
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
Created on ‎03-07-2018 12:15 PM - edited ‎08-18-2019 03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to autoterminate original relationship in ConvertJSONtoSQL processor, now original relationship is loop back into same processor again which is causing all the duplicates in mysql database.
How to Autoterminate original relationship:-
- clear the queue first.
- delete the original relationship
- right click on processor
- goto setting tab
- click on checkbox at original relationship as shown in the below screenshot
.
If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.
Created ‎03-07-2018 12:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Shu,
It worked like charm. Thanks a lot for the quick response.
