Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentTableSchema: Cannot declare primary partition and primary sort key. #4186

Closed
axthosarouris opened this issue Jul 14, 2023 · 3 comments
Labels
bug This issue is a bug. documentation This is a problem with documentation. p2 This is a standard priority issue

Comments

@axthosarouris
Copy link

Describe the bug

class software.amazon.awssdk.enhanced.dynamodb.document.DocumentTableSchema does not have methods "primaryKey", "sortKey" as described in Javadoc in order to define the primary key and the sort key

Expected Behavior

It is expected the Builder to have the methods "primaryKey" and "sortKey" as described in the Javadoc.

Current Behavior

The builder does not have the aforemtioned methods, and therefore we cannot define the class.

Reproduction Steps

The following code from the javadoc does not compile.

DocumentTableSchema.builder().
    .primaryKey("sampleHashKey", AttributeValueType.S)
    .sortKey("sampleSortKey", AttributeValueType.S)
    .build();

Possible Solution

add the methods.

Additional Information/Context

No response

AWS Java SDK version used

2.20.102

JDK version used

11

Operating System and version

Linux

@axthosarouris axthosarouris added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 14, 2023
@debora-ito
Copy link
Member

debora-ito commented Jul 26, 2023

Hi @axthosarouris actually the example is wrong, I'm sorry for that.

The example was probably written based on an early version of the design, but it wasn't updated after the solution evolved.

Please refer to our Developer Guide for up-to-date code examples:
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/ddb-en-client-doc-api-steps.html

We're going to fix the Javadoc.

@debora-ito debora-ito added documentation This is a problem with documentation. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jul 26, 2023
@debora-ito
Copy link
Member

Fixed via #4348.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. documentation This is a problem with documentation. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants