Re: Deserializing JSON into Scala objects in Java code

2015-09-09 Thread Kevin Chen
Marcelo and Christopher, Thanks for your help! The problem turned out to arise from a different part of the code (we have multiple ObjectMappers), but because I am not very familiar with Jackson I had thought there was a problem with the Scala module. Thank you again, Kevin From: Christopher C

Re: Deserializing JSON into Scala objects in Java code

2015-09-08 Thread Marcelo Vanzin
Hi Kevin, This code works fine for me (output is "List(1, 2)"): import org.apache.spark.status.api.v1.RDDPartitionInfo; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.module.scala.DefaultScalaModule; class jackson { public static void main(String[] args) throws

Re: Deserializing JSON into Scala objects in Java code

2015-09-08 Thread Kevin Chen
Hi Marcelo, Thanks for the quick response. I understand that I can just write my own Java classes (I will use that as a fallback option), but in order to avoid code duplication and further possible changes, I was hoping there would be a way to use the Spark API classes directly, since it seems th

Re: Deserializing JSON into Scala objects in Java code

2015-09-08 Thread Marcelo Vanzin
Hi Kevin, How did you try to use the Scala module? Spark has this code when setting up the ObjectMapper used to generate the output: mapper.registerModule(com.fasterxml.jackson.module.scala.DefaultScalaModule) As for supporting direct serialization to Java objects, I don't think that was the g