title: How to deal with array<String> in spark dataframe?
body: <p>I have a json dataset, and it is formated as:</p>
  
  <pre><code>val data = spark.read.json("user.json").select("user_id","friends").show()
  +--------------------+--------------------+
  |             user_id|             friends|
  +--------------------+--------------------+
  |18kPq7GPye-YQ3LyK...|[rpOyqD_893cqmDAt...|
  |rpOyqD_893cqmDAtJ...|[18kPq7GPye-YQ3Ly...|
  |4U9kSBLuBDU391x6b...|[18kPq7GPye-YQ3Ly...|
  |fHtTaujcyKvXglE33...|[18kPq7GPye-YQ3Ly...|
  +--------------------+--------------------+
  data: org.apache.spark.sql.DataFrame = [user_id: string, friends: array&lt;string&gt;]
  </code></pre>
  
  <p>How can I transform it to [user_id: String, friend: String], eg:</p>
  
  <pre><code>+--------------------+--------------------+
  |             user_id|             friend|
  +--------------------+--------------------+
  |18kPq7GPye-YQ3LyK...| rpOyqD_893cqmDAt...|
  |18kPq7GPye-YQ3LyK...| 18kPq7GPye-YQ3Ly...|
  |4U9kSBLuBDU391x6b...| 18kPq7GPye-YQ3Ly...|
  |fHtTaujcyKvXglE33...| 18kPq7GPye-YQ3Ly...|
  +--------------------+--------------------+
  </code></pre>
  
  <p>How can I get this dataframe?</p>