There is a CSV file with the data of people who changed there name: id, former_name, number, first_name, last_name
The former_name can be first or last name.
Here is a sample of data:
id former_name number first_name last_name
Which Jane Do changed her first name first then changed her last name.
There is a table:
Person: person_id, first_name, last_name, number, ...
person_id is created by first_name + last_name +number
I want to check if the person in the CSV file exists in the table or not.
As the id is the combination of the person's first and last name,
If the result of condition 1 is false or the result of condition 2 is more than one record or any record I assume the person in the csv is a new person. So I will add her to the table
But if the result of condition 2 is only one record, I will update the row in the Person table.
I hope it is clear now.
Appreciate any help.
Unfortunately I am confused by your requirement :-( You had specified that there is a Person table and row1 is from Person table and row2 is from csv after Talend processing. Why are you joining both rows?
Could you please repharse your query with example for both datasets and the expected output datasets for each of your query? Then we will get more idea about your requirement.
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Find out how to migrate from one database to another using the Dynamic schema
Read about some useful Context Variable ideas
Pick up some tips and tricks with Context Variables