I've a requirement to map a field in my RDD to another field from another map UserDAO.users
I've tried to figure out the mapping here but can't return the username
yet. I'm getting this in the updated map when I do a foreach print scala.concurrent.impl.Promise$DefaultPromise@7c4c5ddd
Here is my code snippet:
rdd.map { l => {
l.map { case (k, v) => {
k match {
case "a_userid" => {
l.updated("a_username", userDAO.users.map(c => c.filter(f => f.userid == v.toInt)).map(y => y.map(e => e.username)))
}
case _ =>
}
}
}
}
}
So basically,
rdd
- RDD[Map[String, String]]
UserDAO.users - Future[Seq[User]]
- where User is a case class
and returning the updated rdd
- RDD[Map[String, String]]
--
Any idea how to solve this ?
Thanks