Error in running job on Spark 1.4.0 with Jackson module with ScalaObjectMapper

后端 未结 1 476
天命终不由人
天命终不由人 2021-01-17 12:56

I\'m running a spark job written in Scala 2.10.4 and running on Spark 1.4.0 cluster (based on HDFS and managed with YARN) and using Jackson modules version 2.6.1 on Maven re

相关标签:
1条回答
  • 2021-01-17 13:08

    I'm answering the question for further views by other users.

    I stopped using the ScalaObjectMapper and started working with the regular ObjectMapper.

    val jacksonMapper = new ObjectMapper() 
    jacksonMapper.registerModule(DefaultScalaModule)
    

    And it works fine for the time being. Attaching piggybox's comment to be helpful comment:

    The only difference in code is to use classOf[...] to specify type for readValue as the 2nd parameter.

    0 讨论(0)
提交回复
热议问题