title: spark dropDuplicates based on json array field
body: <p>I have json files of the following structure:</p>
  
  <pre><code>{"names":[{"name":"John","lastName":"Doe"},
  {"name":"John","lastName":"Marcus"},
  {"name":"David","lastName":"Luis"}
  ]}
  </code></pre>
  
  <p>I want to read several such json files and distinct them based on the "name" column inside names.
  I tried</p>
  
  <pre><code>df.dropDuplicates(Array("names.name")) 
  </code></pre>
  
  <p>but it didn't do the magic.</p>