I have the data as:
(ID001,List((BookType,[text]),(author,xyz abc),(time,01/12/2019[22:00] CST/PM))),(ID002,List((BookType,[text]),(author,klj fgh),(time,19/02/2019[12:00] CST/AM)))
I need to convert this to a JSON object:
{"ID001":{
"BookType":"[text]",
"author":"xyz abc",
"time":"01/12/2019[22:00] CST/PM"
},
{"ID002": {
"BookType":"[text]" ,
"author":"klj fgh",
"time":"19/02/2019[12:00] CST/AM"
}
}
I am very new to Scala Spark. Any idea how to convert this.