dgadiraju
7/9/2017 - 12:35 AM

scala-spark-create-data-frame.scala

val inputPath = "/Users/itversity/Research/data/retail_db"
val ordersDF = sc.textFile(inputPath + "/orders").
  map(rec => {
    val a = rec.split(",")
    Orders(a(0).toInt, a(1).toString(), a(2).toInt, a(3).toString())
  }).toDF()