apache spark - Loading Scala objects into RDD -
a scala class represents user
. class has companion object .
the class contains toxml()
function, , companion object has fromxml()
function.
class user(val firstname:string, val lastname:string, val age:int, val profession:string){ def toxml(){...} }
an xml file contains list of users, modelled scala class.
a spark rdd needs created\loaded xml file, contains collection of scala objects of type of our class, i.e. rdd[user]
.
what best way this?
thanks
Comments
Post a Comment