Something like this?
val map_rdd = json_rdd.map(json => {
val mapper = new ObjectMapper() with ScalaObjectMapper
mapper.registerModule(DefaultScalaModule)
val myMap = mapper.readValue[Map[String,String]](json)
myMap
})
Thanks
Best Regards
On Wed, Nov 19, 2014 at 11:01 AM, Daniel Haviv <[email protected]>
wrote:
> Hi,
> I'm loading a json file into a RDD and then save that RDD as parquet.
> One of the fields is a map of keys and values but it is being translated
> and stored as a struct.
>
> How can I convert the field into a map?
>
>
> Thanks,
> Daniel
>