title: Convert struct column to Scala list
body: <p>I have a struct column in my dataframe and I want to collect it as a Scala list.</p>
  
  <pre><code>case class Class1(x1: Integer, x2: Double)
  
  val df = Seq(("a", Class1(10,5.5)), ("b", Class1(7,2.1))).toDF("id", "col1")
  </code></pre>
  
  <p>When I try to convert the struct column to an <code>RDD</code> and collect it:</p>
  
  <pre><code>df.select($"col1").rdd.map(x =&gt; x.asInstanceOf[Array[(Integer, Double)]]).collect()
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema cannot be cast to [Lscala.Tuple2;
  </code></pre>
  
  <p>I want to return </p>
  
  <pre><code>List((10,5.5),(7,2.1))
  </code></pre>