I am receiving a JSON String on kafka topic of form
{"user_id":"4BtIrO4vgJUZG3wUxDjihnKbYvw2","travel_mode":"plane","travel_with":["family","couple"],"travel_preferences":"national"}
Now I am using this JSON String in spark and extracting it by
var jValue: JValue=net.liftweb.json.JsonParser.parse(st)
val mailServer = jValue.extract[Reg]
by this I am able to extract all the other things except travel_with which is an array. So please tell me how to extract that array.
Please help
write a case class Reg of the form case class Reg(user_id: String, travel_mode: String, travel_with: List[String],travel_preferences: String) and then you will get travel_with of the form List[ a, b]