I know that Scalding's default serialization uses Kryo. So for this example, lets say I have a pipe of student objects.
case class Student(name:String, id:String)
val pipe: Pipe[Student] = //....
Then I write that pipe to a TextDelimited file using Kryo.
pipe.write(args("output"))
Now that I have these "output" files, how do I easily read them back into Student objects? My general idea is something like the following but it does not work.
Tsv("Kryo output files").read.map {bytes =>
val instantiator = (new ScalaKryoInstantiator).setRegistrationRequired(true)
val kryo = instantiator.newKryo
kryo.register(classOf[Person])
val deserialized = kryo.readObject(new Input(bytes), classOf[Person])
deserialized
}
How do I deserialize my Kryo written text files into the objects they were originally in?