0
火花1.6,我試圖數組保存到一個蜂房表myTable
由兩列,每列array<double>
類型的:陣列<double>星火寫專欄蜂巢表
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")
但後來我得到的消息:
error: value toDF is not a member of org.apache.spark.rdd.RDD[Array[Double]]
val df = sc.parallelize(mySeq).toDF("x","y")
什麼是做這個簡單任務的正確方法?