I have an employee table with few records as below:
+---+----+-------+
| Id | Name | Address|
+---+----+-------+
| 1 | AA | Hyd |
| 2 | BB | Bglr |
| 3 | CC | Chn |
| 4 | DD | Pune |
+---+----+-------+
Now, I got a new employee table.I have to join both tables(old+new) and then wants to do below tasks
1.remove duplicates records
2.replace old records with updated records
3.add new records to my old Employee table
my new table as below:
+---+----+-------+
| Id|Name|Address|
+---+----+-------+
| 1 | AA | Hyd |
| 2 | BB | Bglr |
| 3 | CC | US |
| 4 | DD | IND |
| 5 | EE | Hyd |
| 6 | FF | Chn |
+---+----+-------+
Please help me out, I want to do this using Spark, scala DataFrame. Thanks in advance.