aws-sdk-perl
aws-sdk-perl copied to clipboard
Cannot use response in way documentation suggests
https://metacpan.org/pod/Paws::DynamoDB::BatchGetItemOutput#UnprocessedKeys-=%3E-Paws::DynamoDB::BatchGetRequestMap
A map of tables and their respective keys that were not processed with the current response. The UnprocessedKeys value is in the same form as RequestItems, so the value can be provided directly to a subsequent BatchGetItem operation. For more information, see RequestItems in the Request Parameters section.
If you take the value of 'UnprocessedKeys' and plug it into the 'RequestItems' on a new request it will throw and exception:
Paws::DynamoDB::KeysAndAttributes doesn't have an [...TABLE NAME...] at [...]/Paws/DynamoDB.pm line 45.
(Note I removed our table's name and put in [...TABLE NAME...]
as a placeholder.)
A dump of the UnprocessedKeys structure is:
bless(
{
'Map' => {
'[...TABLE NAME...]' => bless(
{
'Keys' => [
bless(
{
'Map' => {
'key' => bless(
{
'L' => [],
'S' => 'b'
},
'Paws::DynamoDB::AttributeValue'
)
}
},
'Paws::DynamoDB::Key'
),
bless(
{
'Map' => {
'key' => bless(
{
'L' => [],
'S' => 'd'
},
'Paws::DynamoDB::AttributeValue'
)
}
},
'Paws::DynamoDB::Key'
)
]
},
'Paws::DynamoDB::KeysAndAttributes'
)
}
},
'Paws::DynamoDB::BatchGetRequestMap'
),
This is probably just an error due to the docs being mostly generated from AWS and the UnprocessedKeys being turned into a perl object without any logic anywhere to convert it as needed. For my own code I have written tools that transform the data so I can make the necessary additional requests.
Please also note that issue #79 can be seen in that dump as well, but does not appear to be the issue here.