title: Filter DataFrame based on words in array in Apache Spark
body: <p>I am trying to Filter a Dataset by getting only those rows that contains words in array.
  I am using contains method,it works for string but not working for array. Below is code</p>
  
  <pre><code>val dataSet = spark.read.option("header","true").option("inferschema","true").json(path).na.drop.cache()
  
  val threats_path = spark.read.textFile("src/main/resources/cyber_threats").collect()
  
  val newData = dataSet.select("*").filter(col("_source.raw_text").contains(threats_path)).show()
  </code></pre>
  
  <p>It is not working becuase threats_path is array of strings and contains work for string. Any help would be appreciated.</p>