Я пытаюсь нормализовать указанный ниже json файл в 4 таблицы - «содержимое», «Модули», «Изображения» и «Все остальное в другой таблице»
{
"id": "0000050a",
"revision": 1580225050941,
"slot": "product-description",
"type": "E",
"create_date": 1580225050941,
"modified_date": 1580225050941,
"creator": "Auto",
"modifier": "Auto",
"audit_info": {
"date": 1580225050941,
"source": "AutoService",
"username": "Auto"
},
"total_ID": 1,
"name": "Auto_A1AM78C64UM0Y8_B07JCJR5HW",
"content": [{
"ID": ["B01"],
"content_revision": 1580225050941,
"template": {
"module": [{
"id": "module-11",
"text": null,
"header": [{
"id": "title",
"value": null,
"decorators": []
}],
"paragraph": [{
"id": "description",
"value": [],
"decorators": []
}],
"image": [{
"id": "image",
"assetId": "/images/2cdabb786d10.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,970,300_PT0_SX970_V1__",
"src": "image.jpg",
"originalSrc": null
}],
"integer": null,
"chart": null,
"list": null,
"video": null,
"gallery": null,
"composite": null,
"collection": null,
"product": null
}, {
"id": "module-6",
"text": null,
"header": [{
"id": "title1",
"value": "Dest ",
"decorators": []
}, {
"id": "title2",
"value": "cc",
"decorators": []
}, {
"id": "title3",
"value": "Col",
"decorators": []
}, {
"id": "title4",
"value": "C",
"decorators": []
}, {
"id": "caption1",
"value": null,
"decorators": []
}, {
"id": "caption2",
"value": null,
"decorators": []
}, {
"id": "caption3",
"value": null,
"decorators": []
}, {
"id": "caption4",
"value": null,
"decorators": []
}],
"paragraph": [{
"id": "description1",
"value": [" Sport"],
"decorators": [
[]
]
}, {
"id": "description2",
"value": ["elements "],
"decorators": [
[]
]
}, {
"id": "description3",
"value": ["Film "],
"decorators": [
[]
]
}, {
"id": "description4",
"value": ["Our signature "],
"decorators": [
[]
]
}],
"image": [{
"id": "image1",
"assetId": "/images/dbbfc9873e31.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image2_.jpg",
"originalSrc": null
}, {
"id": "image2",
"assetId": "/images/f577ae005.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "test.jpg",
"originalSrc": null
}, {
"id": "image3",
"assetId": "/images/-0df21c5216d0.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image.jpg",
"originalSrc": null
}, {
"id": "image4",
"assetId": "/images/78d26b9c-408c-4299-8ea8-e9257f170320.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image.jpg",
"originalSrc": null
}, {
"id": "thumb1",
"assetId": "/images/-bbbfc9873e31.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image.jpg",
"originalSrc": null
}, {
"id": "thumb2",
"assetId": "/images/e56f577ae005.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image_.jpg",
"originalSrc": null
}, {
"id": "thumb3",
"assetId": "/images/0df21c5216d0.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image_.jpg",
"originalSrc": null
}, {
"id": "thumb4",
"assetId": "/images/-e9257f170320.jpg",
"alt": " ",
"viewLarger": null,
"styleCodes": "__CR0,0,300,300_PT0_SX300_V1__",
"src": "image.jpg",
"originalSrc": null
}],
"integer": null,
"chart": null,
"list": null,
"video": null,
"gallery": null,
"composite": null,
"collection": null,
"product": null
}],
"renderType": "VERTICAL"
},
"locale_data": {
"locale": "en_US",
"identified_by": "MACHINE_DETECT"
}
}],
"badges": []
}
Я могу успешно сгладить JSON в один большой фрейм данных с заголовком в качестве пути JSON. но я хочу нормализовать JSON в отдельные таблицы. Как, например, в таблице модулей должны быть столбцы типа ID
, Text
, Header_ID
, Header_Value
и так далее. В таблице изображений должны быть столбцы типа Image_ID
, Assest_ID
, Src
и т. Д. Может кто-нибудь, пожалуйста, помогите мне нормализовать это JSON в 4 таблицы.