Hello,
I’m trying to create a transformation rule in AWS DMS to add a new column based on the email column’s value. Specifically, I want to check if the email starts with “sample”. Below is the JSON configuration I’m using:
{
"rule-type": "transformation",
"rule-id": "100",
"rule-name": "100",
"rule-action": "add-column",
"rule-target": "column",
"object-locator": {
"schema-name": "public",
"table-name": "users"
},
"value": "email_test",
"expression": "CASE WHEN substr($email, 1, 6)=='sample' THEN 'match' ELSE 'unmatch' END",
"data-type": {
"type": "string",
"length": 50
}
}
However, the condition doesn’t seem to work as expected, and it’s returning ‘unmatch’ even when the email starts with “delete”. Am I using the correct syntax, or is there a better way to perform this kind of pattern matching in DMS? Is it possible to do something similar to a LIKE clause in this context?
Any insights or recommendations would be greatly appreciated!
Thank you.
Thank you for your response.
https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Expressions.html#CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Expressions-SQLite I based my syntax on the “Using a CASE expression” section from this article. The load completes without errors, but despite the fact that the target data exists, ‘unmatch’ is still being entered.
Any insights on what might be causing this issue would be greatly appreciated.