DynamoDB enhanced client DynamoDbIndex.query to return PageIterable
- Ngôn ngữ chính
- Java
- Star
- 2.6k
- Fork
- 1k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 51
Mô tả
### Describe the feature
When using enhanced DynamoDB there is an interface for PageIterable that adds useful functionality on top of SDKIterable.java, namely an iterator across all pages from the result set. The [query method](https://github.com/aws/aws-sdk-java-v2/blob/8f54393ff4e166eb3f56bc1b411b27f6bf0213b5/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbIndex.java#L57) of DynamoDBTable.java returns said useful type, however similar class DynamoDBIndex.java returns the more basic SDKIterable.java in the [query method](https://github.com/aws/aws-sdk-java-v2/blob/8f54393ff4e166eb3f56bc1b411b27f6bf0213b5/services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/client/DefaultDynamoDbTable.java#L177).
This was already raised in https://github.com/aws/aws-sdk-java-v2/issues/2185, but I believe the documentation fix is not the ideal long term solution. The solution would be to provide similar support for query() both in DynamoDBTable and DynamoDBIndex.
When using dynamo console in the browser, the query works the same for the default table index and the created GSIs, the code should behave consistently.
### Is your Feature Request related to a problem?
This requires all consumers of SDK to do extra coding for replicating code that the SDK already distributes. This increases code duplication as is error prone, both issues that PageIterable interface solves in the first place.
### Proposed Solution
Proposal for non-breaking change,
- Keep the existing DynamoDBIndex ```SdkIterable> query(QueryEnhancedRequest request);```
- Add a new method in DynamoDBIndex ```PageIterable query(QueryEnhancedRequest request);```
### Describe alternatives you've considered
_No response_
### Acknowledge
- [ ] I may be able to implement this feature request
### AWS Java SDK version used
2.17.76
### JDK version used
openjdk 11.0.12
### Operating System and version
MacOS 12.0.1
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với các khai báo truy vấn của DynamoDBIndex và DynamoDBTable, sau đó so sánh DefaultDynamoDbIndex.java với DefaultDynamoDbTable.java, đặc biệt là các triển khai truy vấn liên quan. Theo dõi cách PageIterable được trả về cho các truy vấn bảng và xác định hành vi tương ứng của index; hoàn thành khi các truy vấn index cung cấp cùng khả năng hỗ trợ lặp qua các page, đồng thời vẫn duy trì các yêu cầu tương thích được đề xuất.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- aws, java
- Lĩnh vực
- database
- Loại issue
- Tính năng
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 35/100