title: Spark write columns of array<double> to Hive table
body: <p>With Spark 1.6, I try to save Arrays to a Hive-Table <code>myTable</code> consisting of two columns, each of type <code>array&lt;double&gt;</code>:</p>
  
  <pre><code>val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc)
  import sqlContext.implicits._
  
  val x = Array(1.0,2.0,3.0,4.0)
  val y = Array(-1.0,-2.0,-3.0,-4.0)
  
  val mySeq = Seq(x,y)
  val df = sc.parallelize(mySeq).toDF("x","y")
  df.write.insertInto("myTable")
  </code></pre>
  
  <p>But then I get the message:</p>
  
  <pre><code>error: value toDF is not a member of org.apache.spark.rdd.RDD[Array[Double]]
                val df = sc.parallelize(mySeq).toDF("x","y")
  </code></pre>
  
  <p>What is the correct way to do this simple task?</p>