I am trying to read a dataframe which is created using nested jSON. Somehow i am not able to read the one of the nested key and get error.
val df=spark.read.json(Seq("""
[{
"testPlans": [{
"attr1": "abc"
}, {
"attr2": "bac",
"attr3": [{
"uniqueId": "111"
}]
}]
}]""").toDS())
df.select("testPlans.attr1","testPlans.attr2","testPlans.attr3.uniqueId").show()