Extract value from structure within an array of arrays in spark using scala
问题 I am reading json data into spark data frame using scala. The schema is as follows: root |-- metadata: array (nullable = true) | |-- element: struct (containsNull = true) | | |-- playerId: string (nullable = true) | | |-- sources: array (nullable = true) | | | |-- element: struct (containsNull = true) | | | | |-- matchId: long (nullable = true) The data looks as follows: { "metadata" : [ { "playerId" : "1234", "sources" : [ { "matchId": 1 } ] }, { "playerId": "1235", "sources": [ { "matchId":