I'm trying to read out a json config file into my scala project. The format of the json is as follows:
{
"parameters": [
{
"name": "testInteger",
"type": "Integer",
"value": "10"
},
{
"name": "testString",
"type": "String",
"value": "yeah"
}
]
}
I have been using spark to generate a data frame
val df = spark.read.option("multiline","true").json(path)
I am needing the data from the json file to then be read into a Map that has key "name" and value of the specified type
Expected Output:
Map: "testInteger" -> 10
"testString" -> "yeah"
I am new to scala and unsure where to start, any advice would be appreciated.
(Note: using Java 8 and intellij to write)
map.