Hello Aljoscha,
Thanks for your reply. It was really helpful.
After some time to figure out the right syntax it worked perfectly.

val user_interest = lines.map( line => {
                                        val parsed = parse(line)
implicit lazy val formats = org.json4s.DefaultFormats
                                        val name = 
parsed.\("name").extract[String]
                                        val location_x = 
parsed.\("location").\("x").extract[Double]
                                        val location_y = 
parsed.\("location").\("y").extract[Double]
val likes = parsed.\("likes").extract[Seq[String]].map(_.toLowerCase()).mkString(";")
                                        ( UserInterest(name, location_x, 
location_y, likes) )
                                    })

Is this the best way to handle with json data? or is there a more efficient way?

thank you,
norman


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


Reply via email to