I have the following pyspark dataframe df1 :-
| SL No | category 1 | category 2 |
|---|---|---|
| 1 | Apples | Oranges |
| 2 | Apples | APPLE FRUIT |
| 3 | Grapes | Grape |
| 4 | Bananas | Oranges |
| 5 | Orange | Grape |
I want to get the rows of the pyspark dataframe where the column values are not matching b/w columns category 1 and category 2 handling for case partial string match(category 1 contains only Apples/Bananas/Orange/Grapes strings and likewise Category 2 only contains only those distinct strings under Category 2) :-
| SL No | category 1 | category 2 |
|---|---|---|
| 1 | Apples | Oranges |
| 4 | Bananas | Oranges |
| 5 | Orange | Grape |