可能是 JSON 文件格式不正确或文件中的配置项有误导致的错误。需要按照文档要求正确配置 JSON 文件,包括源端和目标端的连接信息、任务类型、映射关系等。同时,可以使用 AWS DMS 控制台上的 Task Assessment Report 查看 JSON 文件中的问题,并及时进行修复。
示例代码如下:
{
"rules": [
{
"rule-type": "transformation",
"rule-id": "1",
"rule-name": "prepare",
"rule-action": "prepare-mapping",
"operand-type": "table",
"apply": "insert,update",
"rule-target": "schema.table",
"input-columns": [],
"output-width": [
{
"target": "column1",
"type": "varchar",
"length": 50
},
{
"target": "column2",
"type": "varchar",
"length": 100
}
],
"transformation-rules": [
{
"rule-type": "selection",
"rule-id": "2",
"rule-name": "select",
"operator": "or",
"rules": [
{
"rule-type": "comparison",
"rule-id": "3",
"rule-name": "compare1",
"source": "column1",
"target": "constant_value",
"operator": "=",
"value": "test"
}
]
}
]
}
]
}