【发布时间】:2022-11-24 06:18:52
【问题描述】:
我正在尝试使用类似于 SQL 中的 GROUP BY 的逻辑在 DynamoDB 中编写查询。让我们考虑下表,分区键为simulation_id:
Simulation (Table):
simulation_id_1 - type_1 - ...
simulation_id_1 - type_1 - ...
simulation_id_1 - type_2 - ...
simulation_id_1 - type_2 - ...
simulation_id_1 - type_2 - ...
simulation_id_2 - type_2 - ...
simulation_id_2 - type_2 - ...
simulation_id_2 - type_2 - ...
simulation_id_2 - type_2 - ...
simulation_id_2 - type_3 - ...
结果将是:
simulation_id_1 - type_1 - 2 (count of entries)
simulation_id_1 - type_2 - 3
simulation_id_2 - type_2 - 4
simulation_id_2 - type_3 - 1
使用 DynamoDbEnhancedClient 实现该目标的最佳方法是什么?
【问题讨论】:
标签: java amazon-dynamodb aws-java-sdk-2.x aws-java-sdk-dynamodb