Member since
10-28-2015
1
Post
0
Kudos Received
0
Solutions
10-28-2015
01:09 PM
Hi, Can you shae your program. I am getting one single error mentioned below:- [info] Compiling 1 Scala source to /home/sumeet/SimpleSparkProject/target/scala-2.11/classes... [error] /home/sumeet/SimpleSparkProject/src/main/scala/SimpleApp.scala:16: value toDF is not a member of org.apache.spark.rdd.RDD[Auction] [error] val auction = ebay.toDF() [error] ^ import org.apache.spark.SparkContext import org.apache.spark.SparkContext._ import org.apache.spark.sql._ object SimpleApp { def main(args: Array[String]) { val sc = new SparkContext("local", "Simple App", "/usr/local/spark-1.4.0-incubating", List("target/scala-2.10/simple-project_2.10-1.0.jar")) val sqlContext = new org.apache.spark.sql.SQLContext(sc) import sqlContext.implicits._ val ebayText = sc.textFile("/home/sumeet/Desktop/useful huge sample data/ebay.csv") ebayText.first() case class Auction(auctionid: String, bid: Float, bidtime: Float, bidder: String, bidderrate: Integer, openbid: Float, price: Float) val ebay = ebayText.map(_.split(",")).map(p => Auction(p(0),p(1).toFloat,p(2).toFloat,p(3),p(4).toInt,p(5).toFloat,p(6).toFloat)) ebay.first() ebay.count() val auction = ebay.toDF() auction.show() } }
... View more