0
我編寫了一個罐子在Spark上運行,我的項目包括廣口瓶是enter image description here星火SQL約rddToDataFrameHolder
和我的Hadoop的火花火花2.0.2彬hadoop2.7 當我運行我的罐子enter image description here 是版本衝突嗎? 後續是我的代碼
case class VehicleInfo(vin: String, vehicle_license: String, sales_id: String)
對象ChangeStatus { DEF主(參數:數組[字符串]):單位= {
//txt path in hdfs
val path = args(0)
val sparkConf = new SparkConf().setAppName("change_status")
val sc = new SparkContext(sparkConf)
val sqlContext = new SQLContext(sc)
import sqlContext.implicits._
val input = sc.textFile(path)
.map(line => line.split("\\|"))
.map(line => VehicleInfo(line(0), line(1), line(2)))
.toDF()
input.registerTempTable("vehicle_info")
val result_df = sqlContext.sql("select * from vehicle_info limit 10")
result_df.show()
} }
什麼是有關該問題的我的碼?