title: How do I filter rows based on whether a column value is in a Set of Strings in a Spark DataFrame
body: <p>Is there a more elegant way of filtering based on values in a Set of String?</p>
  
  <pre><code>def myFilter(actions: Set[String], myDF: DataFrame): DataFrame = {
    val containsAction = udf((action: String) =&gt; {
      actions.contains(action)
    })
  
    myDF.filter(containsAction('action))
  }
  </code></pre>
  
  <p>In SQL you can do</p>
  
  <pre><code>select * from myTable where action in ('action1', 'action2', 'action3')
  </code></pre>