I have a dataframe df, which like below data:
| path |dst|
|1->2->3| 2 |
|1->2->3| 4 |
Now I want to filter out where dst isin path, So the result df I want as below:
| path |dst|
|1->2->3| 4 |
I had try:
df.filter(v=>v.getAs[String]("path").split("->").contains(v.getAs[String]("dst")))
which return the df that path contain dst, and then I want to use not:
df.filter(!(v=>v.getAs[String]("path").split("->").contains(v.getAs[String]("dst")))
df.filter(~(v=>v.getAs[String]("path").split("->").contains(v.getAs[String]("dst")))
but Idea is red under my code. So what can I do?