我试图在PartiQL AWS v3中发送一批NodeJS语句。该语句对于单个ExecuteStatementCommand运行良好,但批处理命令不工作。
这句话看起来像
const statement = `
SELECT *
FROM "my-table"
WHERE "partitionKey" = '1234'
AND "filterKey" = '5678'
`此代码段按预期工作:
const result = await dynamodbClient.send(new ExecuteStatementCommand(
{ Statement: statement}
))批处理片段没有:
const result = await dynamodbClient.send(new BatchExecuteStatementCommand({
Statements: [
{
Statement: statement
}
]
}))批处理调用会产生以下错误:
"Code": "ValidationError",
"Message": "Select statements within BatchExecuteStatement must specify the primary key in the where clause."任何洞察力都会受到极大的赞赏。谢谢你抽出时间阅读我的问题!
发布于 2022-06-18 13:32:17
看来我需要的是一只橡皮鸭。
DynamoDB主键由分区键+排序键组成。我的特定表有一个排序键,这是语句中缺少的。批处理作业不能处理响应的筛选,而且每个语句必须匹配数据库中的单个项。
https://stackoverflow.com/questions/72669545
复制相似问题