Skip to content

Issue with Unexpected Characters Values in Parquet Files Generated by AWS DMS

0

Hello AWS Community,

I am encountering an issue while using AWS Database Migration Service (DMS) to migrate data from MySQL to S3 in Parquet format. Although everything looks good in my source SQL database and the DMS dump in S3, I am seeing unexpected characters (Please see attached screen shot). The first record is the Insert record (I) and the second record is the update record (U). We can't resolve this issue and the DMS cloud watch logs not giving any info about it.

Enter image description here

Here is my DMS S3 Endpoint settings { "ServiceAccessRoleArn": "arn:aws:iam::820904636791:role/glue-mysql-to-sf-dms-role-prd", "ExternalTableDefinition": "", "CsvRowDelimiter": "\n", "CsvDelimiter": ",", "BucketFolder": "events_all_data/", "BucketName": "aws-mysql-to-sf-glue-scripts-prd-us-west-2", "CompressionType": "NONE", "EncryptionMode": "SSE_S3", "DataFormat": "parquet", "EncodingType": "rle-dictionary", "DictPageSizeLimit": 1048576, "RowGroupLength": 10000, "DataPageSize": 1048576, "ParquetVersion": "parquet-2-0", "EnableStatistics": true, "IncludeOpForFullLoad": false, "CdcInsertsOnly": false, "TimestampColumnName": "recordchangedate", "ParquetTimestampInMillisecond": false, "CdcInsertsAndUpdates": false, "DatePartitionEnabled": false, "DatePartitionSequence": "yyyymmdd", "DatePartitionDelimiter": "slash", "UseCsvNoSupValue": false, "PreserveTransactions": false, "UseTaskStartTimeForFullLoadTimestamp": false, "CannedAclForObjects": "none", "AddColumnName": true, "CdcMaxBatchInterval": 300, "CdcMinFileSize": 200000, "CsvNullValue": "NULL", "IgnoreHeaderRows": 0, "MaxFileSize": 1048576, "Rfc4180": true, "GlueCatalogGeneration": false }

1 Answer
1

The issue you're experiencing with unexpected characters in Parquet files generated by AWS DMS is likely related to character encoding and conversion during the migration process. This can happen when data goes through multiple decoding and encoding phases as it's read from the source database, processed in the AWS DMS replication instance, and finally loaded into the target (in this case, S3 in Parquet format).

There are a few potential causes and solutions to consider:

  1. Character set mismatch: Ensure that the character sets used in your source MySQL database and the DMS task are compatible. You can check your MySQL database's character-related parameters using the command:

    SHOW VARIABLES LIKE '%char%';

  2. UTF8MB4 encoding: If your source tables or databases are using UTF8MB4 encoding, make sure you're using AWS DMS engine version 3.1.1 or later, as earlier versions don't support this character set.

  3. Character set mapping: You may need to use the CharsetMapping extra connection attribute to specify character set mapping. This can help resolve issues with unsupported character sets.

  4. Lossy conversion: If there's an inappropriate configuration set up, such as a Unicode to Latin character set conversion, it could result in data errors due to lossy conversion.

  5. Collation settings: Differences in accent sensitivity and case sensitivity between your source and target can cause unexpected results. For example, if your source is accent-sensitive and case-sensitive, but your target treats accented and non-accented characters the same, it could lead to issues.

To troubleshoot and resolve this issue:

  1. Review your source database's character set and collation settings.
  2. Check your AWS DMS task settings, particularly any character set mappings or conversions.
  3. Consider using a validation-only task in AWS DMS to identify specific records causing issues.
  4. If possible, upgrade to the latest AWS DMS engine version to ensure support for all character sets.
  5. If the issue persists, you may need to implement custom character substitution in your DMS task settings to handle problematic characters.

Remember to test any changes thoroughly in a non-production environment before applying them to your production migration task.
Sources
Troubleshooting migration tasks in AWS Database Migration Service - AWS Database Migration Service
Troubleshooting - Amazon Aurora MySQL Migration Handbook
Optimize data validation using AWS DMS validation-only tasks | AWS Database Blog
Character substitution task settings - AWS Database Migration Service

answered 2 years ago

EXPERT

reviewed 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.