I would like to know if there is a way to flatten deeply nested JSON using Glue ETL job? This has nested arrays in it. I tried to run a Glue crawler on the JSON which returned a catalog with just 1 field PerPlayer with a struct data type. In the glue ETL job should I be using a catalog or just read the JSON into dynamicframe and perform some transform to flatten it? I was able to flatten using relationalize if there is only 1 record (without array), but my input has got several records in an array structure and some of the records have some nested arrays within it.
I am entirely new to Glue ETL, so any advice or suggestion would be greatly appreciated.
{
"PerPlayer": {
"requestNo": "REQ912",
"Batch_Number": "1",
"Total_No_Of_Batches": "1",
"player": [
{
"username": "user1",
"characteristics": {
"race": "Human",
"class": "Warlock",
"subclass": "Dawnblade",
"power": 300,
"playercountry": "USA"
},
"arsenal": [
{
"kinetic": {
"name": "Sweet Business",
"type": "Auto Rifle",
"power": 300,
"element": "Kinetic"
},
"energy": {
"name": "MIDA Mini-Tool",
"type": "Submachine Gun",
"power": 300,
"element": "Solar"
},
"power": {
"name": "Play of the Game",
"type": "Grenade Launcher",
"power": 300,
"element": "Arc"
}
},
{
"kinetic": {
"name": "Sweet Business1",
"type": "Auto Rifle1",
"power": 300,
"element": "Kinetic1"
},
"energy": {
"name": "MIDA Mini-Tool",
"type": "Submachine Gun",
"power": 300,
"element": "Solar1"
},
"power": {
"name": "Play of the Game1",
"type": "Grenade Launcher1",
"power": 300,
"element": "Arc1"
}
}
],
"armor": {
"head": "Eye of Another World",
"arms": "Philomath Gloves",
"chest": "Philomath Robes",
"leg": "Philomath Boots",
"classitem": "Philomath Bond"
},
"location": {
"map": "Titan",
"waypoint": "The Rig"
}
},
{
"username": "user2",
"characteristics": {
"race": "Alien",
"class": "Starwars",
"subclass": "Dawnblade",
"power": 300,
"playercountry": "USA"
},
"arsenal": {
"kinetic": {
"name": "salt Business",
"type": "Auto Rifle",
"power": 300,
"element": "Kinetic"
},
"energy": {
"name": "MIDA Mini-Tool",
"type": "Submachine Gun",
"power": 300,
"element": "Solar"
},
"power": {
"name": "Play of the Game",
"type": "Grenade Launcher",
"power": 400,
"element": "Arc"
}
},
"armor": {
"head": "Eye of Another World",
"arms": "Philomath Gloves",
"chest": "Philomath Robes",
"leg": "Philomath Boots",
"classitem": "Philomath Bond"
},
"location": {
"map": "Titan",
"waypoint": "The Rig"
}
}
]
}
}