title: Filter dataframe by values in a list of dictionaries in pyspark
body: <p>In <code>pyspark</code>, how do I  to filter a <code>dataframe</code> that has a column that is a list of dictionaries, based on a specific dictionary key's value?</p>
  
  <p>That is, filter the rows whose <code>foo_data</code> <em>dictionaries</em> have <em>any</em> value in my list for the <code>name</code> attribute.</p>
  
  <pre><code># The dataframe
  # df.show()
  
     foo_data                                   bar_id
  0  [{'name': 'Foo 1'}, {'name': 'Foo 2'}]     42189321899fewa32
  1  [{'name': 'Foo 1'}, {'name': 'Foo 3'}]     13829a38291dm2198
  2  [{'name': 'Foo 2'}, {'name': 'Foo 3'}]     3910m312091412812
  3  [{'name': 'Foo 2'}, {'name': 'Foo 4'}]     2189d2n18u9218219
  
  # The values for the "name" key in the dictionaries of the column "foo_data"
  foo_list = [
      "Foo 1",
      "Foo 4"
  ]
  
  # df_filtered = df.filter...?
  </code></pre>