Json Shift-JOLT变换-下面的变换面临的问题
我正在尝试转换下面的输入json,以便在保留所有元数据的同时平坦化必要的列名及其值Json Shift-JOLT变换-下面的变换面临的问题,json,transformation,jolt,Json,Transformation,Jolt,我正在尝试转换下面的输入json,以便在保留所有元数据的同时平坦化必要的列名及其值 [ { "operation": "shift", "spec": { "columns": { "*": { "@(value)": "[#1].@(1,name)" } } } } ] 下面是我为我的CDC用例准备的输入json { "type": "update", "timestamp":
[
{
"operation": "shift",
"spec": {
"columns": {
"*": {
"@(value)": "[#1].@(1,name)"
}
}
}
}
]
下面是我为我的CDC用例准备的输入json
{
"type": "update",
"timestamp": 1558346256000,
"binlog_filename": "mysql-bin-changelog.000889",
"binlog_position": 635,
"database": "books",
"table_name": "publishers",
"table_id": 111,
"columns": [
{
"id": 1,
"name": "id",
"column_type": 4,
"last_value": 2,
"value": 2
},
{
"id": 2,
"name": "name",
"column_type": 12,
"last_value": "Suresh",
"value": "Suresh123"
},
{
"id": 3,
"name": "email",
"column_type": 12,
"last_value": "Suresh@yahoo.com",
"value": "Suresh@yahoo.com"
}
]
}
下面是预期的json输出
我尝试了下面的规范,从中可以检索columns对象,但不能检索其余的元数据
[
{
"operation": "shift",
"spec": {
"columns": {
"*": {
"@(value)": "[#1].@(1,name)"
}
}
}
}
]
任何线索都将不胜感激 我得到了上述转换的震动规范。我把它贴在这里,以防有人偶然发现类似的东西
[
{
"operation": "shift",
"spec": {
"columns": {
"*": {
"@(value)": "columns.@(1,name)"
}
},
"*": "&"
}
}
]