我想知道是否有一种方法可以使用 Glue ETL 作业来展平深度嵌套的 JSON?这里面有嵌套的数组。我试图在 JSON 上运行一个 Glue 爬虫,它返回一个目录,其中只有 1 个字段 PerPlayer 和一个结构数据类型。在胶水 ETL 作业中,我应该使用目录还是只是将 JSON 读入动态框架并执行一些转换以将其展平?如果只有 1 条记录(没有数组),我可以使用关系化进行展平,但是我的输入在数组结构中有几条记录,并且其中一些记录中有一些嵌套数组。
我对 Glue ETL 完全陌生,因此非常感谢任何建议或建议。
{
"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"
}
}
]
}
}