英文:
AWS GLUE Dynamodb - How to retain empty columns as empty when migrating data in glue
问题
I'm trying to migrate the data from one dynamodb table which contains two columns(country, isMinor
) as empty for few items to another dynamodb
table.
But after migration it puts null values in target dynamodb
table for these two missing columns
Is there any way this is possible. Appreciate quick help on this.
Thanks in advance.
例如,在源表中:
item1 = {
"Name": {
"S": "ABCD"
},
"Age": {
"N": "10"
}
}
item2 = {
"Name": {
"S": "DEFG"
},
"Country": {
"S": "XYZ"
},
"isMinor": {
"BOOL": true
},
"Age": {
"N": "11"
}
}
迁移后,item1
显示为:
item1 = {
"Name": {
"S": "ABCD"
},
"Country": {
"NULL": true
},
"isMinor": {
"NULL": true
},
"Age": {
"N": "11"
}
但迁移后目标 dynamodb
表的预期结果如下(与源表中的项目相同):
item1 = {
"Name": {
"S": "ABCD"
},
"Age": {
"N": "10"
}
}
英文:
I'm trying to migrate the data from one dynamodb table which contains two columns(country, isMinor
) as empty for few items to another dynamodb
table.
But after migration it puts null values in target dynamodb
table for these two missing columns
Is there any way this is possible. Appreciate quick help on this.
Thanks in advance.
e.g. In source table:
item1 = {
"Name": {
"S": "ABCD"
},
"Age": {
"N": "10"
}
}
item2 = {
"Name": {
"S": "DEFG"
},
"Country": {
"S": "XYZ"
},
"isMinor": {
"BOOL": true
},
"Age": {
"N": "11"
}
}
After migration it shows item1
as:
item1 = {
"Name": {
"S": "ABCD"
},
"Country": {
"NULL": true
},
"isMinor": {
"NULL": true
},
"Age": {
"N": "11"
}
But the expectation after migration in target dynamodb
table is as below(same as the item in the source table):
item1 = {
"Name": {
"S": "ABCD"
},
"Age": {
"N": "10"
}
}
答案1
得分: 1
很遗憾,这就是Glue将数据写入DynamoDB的方式,因为Glue需要一个结构化模式。
根据您的迁移类型,如果您不需要对数据进行转换,您可以考虑使用以下选项:
英文:
Unfortunately this is how Glue will write the data to DynamoDB, as Glue expects a structured schema.
Depending on your type of migration, if you do not require transformation of the data you may be able to use
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论