I want to use AWS Glue to import that data into a dynamoDB table with partion key 'classId' (string) and sort key 'itemId' (number)
Can someone tell me how to represent the sort key in the Glue job script I am using
When I do
# Map the source field names and data types to target values. The target values should be exactly the
# same as the source DyanmoDB table values
Mapped = ApplyMapping.apply(frame = Source, mappings = [
("item.classId.S", "string", "classId", "string"),
("item.itemId.N", "number", "itemId", "number"),
],
transformation_ctx = "Mapped")
I get the error
IllegalArgumentException: 'Invalid type name number'
If I use
("item.itemId.N", "string", "itemId", "string"),
I get the error
The provided key element does not match the schema
How do I represent the sort key in this code ?
Thanks for any help
question from:
https://stackoverflow.com/questions/65945169/how-to-represent-a-sort-key-of-type-number-in-a-glue-python-job-script 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…