Skip to content

Rename automatic "op" column in DMS

0

DMS adds an op column (operation) to store the type of CRUD operation performed on the row.

Is it possible to rename this column?

asked 2 years ago469 views

2 Answers
0
Accepted Answer

While the "Op" column cannot be renamed, you can add a new column (with your preferred column name) which shows the operation that was performed (i.e INSERT, UPDATE, or DELETE). This can be done using transformation rules and expression AR_H_OPERATION.

You can add the below transformation rule to add a new column named "operation_performed" which contains the operation that was performed:

{
            "rule-type": "transformation",
            "rule-id": "2",
            "rule-name": "2",
            "rule-target": "column",
            "object-locator": {
                "schema-name": "%",
                "table-name": "%"
            },
            "rule-action": "add-column",
            "value": "operation_performed",
            "expression": "$AR_H_OPERATION",
            "data-type": {
                "type": "string",
                "length": 50
            }
        }

Sample output for full loads:

Op,InitialLoadTimestamp,c1,c2,operation_performed
I,2024-07-19 05:01:17.084630,1,1,INSERT

Please refer to the following document for more details: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Expressions.html#CHAP_Tasks.CustomizingTasks.TableMapping.SelectionTransformation.Expressions-Headers

AWS
SUPPORT ENGINEER

answered 2 years ago

0

Unfortunately the operation column name cannot renamed

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.