DynamoDB QueryRequest不返回所有结果

发布于 2025-01-29 10:32:40 字数 1024 浏览 4 评论 0原文

    val queryReq: com.amazonaws.services.dynamodbv2.model.QueryRequest = new com.amazonaws.services.dynamodbv2.model.QueryRequest(tableName)
                    .withIndexName(...)
                    .addKeyConditionsEntry(..., new com.amazonaws.services.dynamodbv2.model.Condition()
                                        .withAttributeValueList(Seq(new com.amazonaws.services.dynamodbv2.model.AttributeValue(...)):_*)
                                        .withComparisonOperator(...))
                    .addKeyConditionsEntry(..., new com.amazonaws.services.dynamodbv2.model.Condition()
                                        .withAttributeValueList(Seq(new com.amazonaws.services.dynamodbv2.model.AttributeValue().withN(...)):_*)
                                        .withComparisonOperator(...))
                    .withScanIndexForward(scanDirection)
                    .withLimit(5000000)

此查询的limit = 5000000,但仅返回了大约3000个结果。 DynamoDB在每个查询中返回多少数据有限吗?如果是这样,是否有一种干净的方法来克服这一限制?

    val queryReq: com.amazonaws.services.dynamodbv2.model.QueryRequest = new com.amazonaws.services.dynamodbv2.model.QueryRequest(tableName)
                    .withIndexName(...)
                    .addKeyConditionsEntry(..., new com.amazonaws.services.dynamodbv2.model.Condition()
                                        .withAttributeValueList(Seq(new com.amazonaws.services.dynamodbv2.model.AttributeValue(...)):_*)
                                        .withComparisonOperator(...))
                    .addKeyConditionsEntry(..., new com.amazonaws.services.dynamodbv2.model.Condition()
                                        .withAttributeValueList(Seq(new com.amazonaws.services.dynamodbv2.model.AttributeValue().withN(...)):_*)
                                        .withComparisonOperator(...))
                    .withScanIndexForward(scanDirection)
                    .withLimit(5000000)

This query is having withLimit = 5000000, but only returned about 3000 results. Is there a limit in how much data being returned by dynamodb in each query? If so, is there a clean way to overcome this limit?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮邮递员 2025-02-05 10:32:40

我刚找到解决方案。所以我会回答自己的问题:
当GetLastEvaLeDKey()不是空或空的时,我可以创建一个附加结果集的wir循环。

I just found the solution. So I will answer my own question:
I can just create a while loop that appends to the result set when getLastEvaluatedKey() is not null nor empty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文