I am working with pyspark dataframe. I have a column words (array<string>)as shown below:
+---+--------------------------------------------------------------------------------+
| id| words|
----+--------------------------------------------------------------------------------+
|012|[content, type, multipart, alternative, boundaries, nextpart, nextpart, drama,..|
|013|[received, from, am5eur02ht120, eop, eur02, prod, protection, outlook by, pro...|
|014|[data, care, much, important, information, summer, care, send, faraway, forget..|
Also I have a list of words:
list = ["protection", "content", "received"]
I want to filter rows which have any value from the list.
Expected output:
+---+--------------------------------------------------------------------------------+
| id| words|
----+--------------------------------------------------------------------------------+
|012|[content, type, multipart, alternative, boundaries, nextpart, nextpart, drama,..|
|013|[received, from, am5eur02ht120, eop, eur02, prod, protection, outlook by, pro...|