I facing issue on extracting the json data frame

dataframes

#1

Hi All ,
Please. find the below JSON and dataset script. Because of array and nested JSON facing issue
on extraction.

EX:- “type”: “glin”, “value”: “195500259888” (GLIN is column name and 195500259888 is data)

val eDF =spark.read.option(“multiLine”, true).json("/Users/aksekhar/workspace/MacD/test_json.json")

json:

{
“modified_date”: “20180530”,
“country”: “us”,
“gerid”: “”,
“ids”: [
{ “type”: “glin”, “value”: “195500259888” },
{ “type”: “nsn”, “value”: “00762” }
],
“people”:[
{ “person”: {
“modified”: “20180530”,
“ids”: [
{ “type”: “payroll”, “value”: null },
{ “type”: “geid”, “value”: “3151665” }
],
“first_name”: “Ashutosh”,
“last_name”: “Tripathi”,
“middle_initial”: null,
“email”: "abx@gmail.com",
“matching_criteria”: [
{ “number”: “1”, “hashed”: “no”, “text”: “MRA” },
{ “number”: “2”, “hashed”: “no”, “text”: “TZX” },
{ “number”: “3”, “hashed”: “no”, “text”: “6789” },
{ “number”: “4”, “hashed”: “no”, “text”: “200001” },
{ “number”: “5”, “hashed”: “no”, “text”: “21000” },
{ “number”: “6”, “hashed”: “no”, “text”: "abc@gmail.com" }
],
“organization_start_date”: “20180530” ,
“organization_termination_date”: null,
“shares”: [
],
“jtcs”: [
{
“code”: “00647”,
“start_date”: “20180530”,
“end_date”: null,
“type”: “P”
}
]
}},
{ “person”: {
“modified”: “20180530”,
“ids”: [
{ “type”: “payroll”, “value”: null },
{ “type”: “geid”, “value”: “3151666” }
],
“first_name”: “Mitali”,
“last_name”: “Sopte”,
“middle_initial”: “V”,
“email”: "xyz@gmail.com",
“matching_criteria”: [
{ “number”: “1”, “hashed”: “no”, “text”: “MRS” },
{ “number”: “2”, “hashed”: “no”, “text”: “xcdd” },
{ “number”: “3”, “hashed”: “no”, “text”: “6789” },
{ “number”: “4”, “hashed”: “no”, “text”: “199511” },
{ “number”: “5”, “hashed”: “no”, “text”: “60523” },
{ “number”: “6”, “hashed”: “no”, “text”: "cccc@gmail.com" }
],
“organization_start_date”: “20180530” ,
“organization_termination_date”: null,
“shares”: [
],
“jtcs”: [
{
“code”: “00650”,
“start_date”: “20180530”,
“end_date”: null,
“type”: “P”
}
]
}}
]
}