aws / aws/aws-sdk-java-v2

DynamoDB enhanced client DynamoDbIndex.query to return PageIterable

オープン
#2,855 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る
dynamodb-enhanced feature-request p3
主要言語
Java
スター
2.6k
フォーク
1k
平均マージ
2日 9時間
マージ済み PR(30日)
51

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

DynamoDBIndex と DynamoDBTable のクエリ宣言から始め、次に DefaultDynamoDbIndex.java と DefaultDynamoDbTable.java を比較します。特に、関連するクエリ実装を確認してください。テーブルクエリで PageIterable がどのように返されるかを追跡し、対応するインデックスの動作を判断します。インデックスクエリが、提案された互換性要件を維持しながら、同じページ反復サポートを提供できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, java
領域
database
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。