I am receiving following error in Spark-Shell while executing following code.

 /class LogRecrod(logLine: String) extends Serializable {
    val splitvals = logLine.split(",");
    val strIp: String = splitvals(0)
    val hostname: String = splitvals(1)
    val server_name: String = splitvals(2)
  }/

/var logRecordRdd: org.apache.spark.rdd.RDD[LogRecrod] = _/

/ val sourceFile =
sc.textFile("hdfs://192.168.1.30:9000/Data/Log_1406794333258.log", 2)/
14/09/04 12:08:28 INFO storage.MemoryStore: ensureFreeSpace(179585) called
with curMem=0, maxMem=309225062
14/09/04 12:08:28 INFO storage.MemoryStore: Block broadcast_0 stored as
values to memory (estimated size 175.4 KB, free 294.7 MB)
sourceFile: org.apache.spark.rdd.RDD[String] = MappedRDD[1] at textFile at
<console>:12


/scala>     logRecordRdd = sourceFile.map(line => new LogRecrod(line))/
/<console>:18: error: type mismatch;
 found   : LogRecrod
 required: LogRecrod
           logRecordRdd = sourceFile.map(line => new LogRecrod(line))/

Any suggestions to resolve this problem?




--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/error-type-mismatch-while-assigning-RDD-to-RDD-val-object-tp13429.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to