Input Table:
| ID | Phone Number |
|---|---|
| 1 | 202-555-0188:202-555-0132 |
| 2 | 202-555-0104:202-555-0132 |
| 3 | 202-555-0104:202-555-0162 |
| 4 | 202-555-0181:202-555-0188:202-556-7191 |
| 5 | 518-555-0110 |
Given above table how can you filter out all the duplicate numbers in Phone Number Column? Numbers must be unique across the entire column, not just for that particular cell.
- How to use RDD to achieve the same?
- Can it be done using just SQL?
Expected Output:
| ID | Phone Number |
|---|---|
| 1 | 202-555-0188:202-555-0132 |
| 2 | 202-555-0104 |
| 3 | 202-555-0162 |
| 4 | 202-555-0181:202-556-7191 |
| 5 | 518-555-0110 |
Explanation:
- 202-555-0132 - is a duplicate in row 2 from row 1, thus removed
- 202-555-0104 - is a duplicate in row 3 from row 2, thus removed
- 202-555-0188 - is a duplicate in row 4 from row 1, thus removed
Assumption: There will be atleast one unique number per row.