title: Spark SQL search inside an array for a struct
body: <p>My data structure is defined approximately as follows:</p>
  
  <pre><code>schema = StructType([
  # ... fields skipped
  StructField("extra_features", 
  ArrayType(StructType([
      StructField("key", StringType(), False),
      StructField("value", StringType(), True)
  ])), nullable = False)],
  )
  </code></pre>
  
  <p>Now, I'd like to search for entries in a data frame where a struct <code>{"key": "somekey", "value": "somevalue"}</code> exists in the array column. How do I do this?</p>