在为AWS Data Migration Service中的S3创建源端点时定义表结构时是否有1000个字符集的限制

时间:2019-06-06 11:11:14

标签: amazon-web-services amazon-s3 database-migration aws-dms

我想在aws dms中为s3存储桶创建一个端点,以将数据从s3迁移到redshift。以JSON格式定义表结构时,出现错误,字符数限制设置为1000个字符。是否可以四处走走,还是我做错了什么? 在AWS DMS网站上共享的Json模板还具有超过1000个字符。我正在考虑如果表结构包含20列以上的内容,那么该怎么走。

此外,如果有人为SQL Server创建了一个dms任务以将s3重新迁移到s3。我想了解启用复制后在s3存储桶中创建的更新文件如何作为更新而不是新表或行加载到redshift。

谢谢。

我尝试删除空格和eol个字符

{
    "TableCount": "1",
    "Tables": [
        {
            "TableName": "employee",
            "TablePath": "hr/employee/",
            "TableOwner": "hr",
            "TableColumns": [
                {
                    "ColumnName": "Id",
                    "ColumnType": "INT8",
                    "ColumnNullable": "false",
                    "ColumnIsPk": "true"
                },
                {
                    "ColumnName": "LastName",
                    "ColumnType": "STRING",
                    "ColumnLength": "20"
                },
                {
                    "ColumnName": "FirstName",
                    "ColumnType": "STRING",
                    "ColumnLength": "30"
                },
                {
                    "ColumnName": "HireDate",
                    "ColumnType": "DATETIME"
                },
                {
                    "ColumnName": "OfficeLocation",
                    "ColumnType": "STRING",
                    "ColumnLength": "20"
                }
            ],
            "TableColumnsTotal": "5"
        }
    ]
}

错误:不得超过1000个字符

1 个答案:

答案 0 :(得分:0)

在UNIX系统(EC2,..)上,使用tr -s " "。当您的数据带有标签时,请首先使用expand -1

echo '{
    "TableCount": "1",
    "Tables": [
        {
            "TableName": "employee",
            "TablePath": "hr/employee/",
            "TableOwner": "hr",
            "TableColumns": [
                {
                    "ColumnName": "Id",
                    "ColumnType": "INT8",
                    "ColumnNullable": "false",
                    "ColumnIsPk": "true"
                },
                {
                    "ColumnName": "LastName",
                    "ColumnType": "STRING",
                    "ColumnLength": "20"
                },
                {
                    "ColumnName": "FirstName",
                    "ColumnType": "STRING",
                    "ColumnLength": "30"
                },
                {
                    "ColumnName": "HireDate",
                    "ColumnType": "DATETIME"
                },
                {
                    "ColumnName": "OfficeLocation",
                    "ColumnType": "STRING",
                    "ColumnLength": "20"
                }
            ],
            "TableColumnsTotal": "5"
        }
    ]
}' | tr -s " "