0

I'm trying to use AWS DMS (Database Migration Service) to load data from a .csv file stored into S3 to AWS DynamoDB. One of the columns (the last one) in the csv file is a list. Sample data:

dfjkgvkweli23urfebkfjb34i2u4|1|["add","dsf","ffc"]
kdhki3jbg4ou43j3lrnkjnb3j4k4|1|["ssd","34s","gfg"]

I've used pipes as separators in order to avoid problems with vector separation colons.

This page here describes how to use object mapping to tell DynamoDB what the data type should be: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html

It seems that I should be able to use the "attribute-type" and "attribute-sub-type", however they are poorly documented, with respect to allowable values.

What I've tested is to use is "scalar" type and "string" sub-type, like this:

{
    "target-attribute-name": "list-attribute",
    "attribute-type": "scalar",
    "attribute-sub-type": "string",
    "value": "${list-attribute}"
}

But when I do this, the data is inserted into dynamoDB scaping double quotes in the target output. I've tried to scape using another double quote for each one, but the result is even worst because another double quote is added to the string.

I guess that there must be another way to scape the double quotes or to map the attribute as another type of data (I've tested "vector", "array" and "list" values) that can get data as is.

Does anyone know how can I scape double quotes or even better how can I map this field as a list or something similar using DMS?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.