Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I need to read the below format of json file and replace values mentioned as @1,@2,@3... so on using values from context variables. I then need to generate an output json in the same structure.
{
"configSparkApp": {
"applicationName": "",
"master": "",
"deployMode": "",
"driverMemory": "",
"numExecutors": "",
"executorCores": "",
"executorMemory": "",
"yarnPool": "",
"logLevel": "",
"logHdfsRootPath": "",
"log4jConfigFileDriver": "",
"log4jConfigFileExecutor": ""
},
"source": {
"dataWarehouseType": "stringvalue",
"configKudu": {
"kuduMaster": "",
"kuduPort": "",
"configTableKudu": [{
"databaseName": "stringvalue",
"tableName": ""
}
]
},
"configHive": [{
"databaseName": "@1",
"tableName": "@2",
"tableFormat": "stringvalue"
}
]
},
"dataPreparation": {
"dataFramePrepared": [{
"dataframeName": "@3",
"query": "@4",
"parameterPosition": "stringvalue"
}
]
},
"rule": {
"relation": "",
"validationColumnName": "stringvalue",
"validationRule": "@5",
"inScopeRule": "",
"exception": [{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "stringvalue",
"columnPosition": ""
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "",
"columnPosition": "stringvalue"
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "'stringvalue'",
"columnPosition": ""
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "",
"columnPosition": "stringvalue"
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "",
"columnPosition": "stringvalue"
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "",
"columnPosition": "stringvalue"
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "",
"columnPosition": "stringvalue"
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "@6",
"columnPosition": ""
},
{
"columnName": "stringvalue",
"columnCalculated": "stringvalue",
"columnLogic": "@7",
"columnPosition": ""
}
],
"summary": {
"configSummary": [
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
},
{
"columnName": "stringvalue",
"columnLogic": "cast('@3' as string)"
},
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
},
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
}
],
"aggColumnSummary": [
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
},
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
},
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
},
{
"columnName": "stringvalue",
"columnLogic": "stringvalue"
}
]
}
}
}
Please let me know how it is possible to manipulate a json of this structure via Talend and what components I'll need to use.
To read , edit values , and generate a complex JSON file programmatically , you ca use a programming language with JSON support , such as Python.
Hi @John Kimber , thanks for replying
Using Talend is necessary for my requirement, is there any way we can incorporate a custom python code in Talend