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

Use String instead of Select enum for ProjectionExpression to support future values #5547

Open
1 of 2 tasks
shetsa-amzn opened this issue Aug 30, 2024 · 2 comments
Open
1 of 2 tasks
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue

Comments

@shetsa-amzn
Copy link
Contributor

Describe the feature

The DynamoDB Java SDK provides an enum called Select to represent the different options for the ProjectionExpression parameter in DynamoDB queries and scans. The ProjectionExpression parameter allows you to specify which attributes you want to retrieve from the table. So idea is to use String instead of Select enum for ProjectionExpression to support future values

Use Case

AWS may introduce new options for the ProjectionExpression parameter in future DynamoDB API versions. However, the Select enum in the SDK may not be updated immediately to include these new options. This can cause issues for customers who cannot upgrade their SDK version right away, as they won't be able to use the new ProjectionExpression options until the SDK is updated and they upgrade to the new version.

Proposed Solution

Instead of using the Select enum, the proposed solution is to use a String internally when specifying the ProjectionExpression parameter. This approach is similar to how the code-generated models in the SDK handle unknown values.

By using a String, customers who cannot upgrade their SDK version immediately can still specify the new ProjectionExpression options introduced by AWS. They can pass the new options as String values instead of relying on the Select enum, which may not have been updated yet.

This solution provides more flexibility and backward compatibility, allowing customers to take advantage of new DynamoDB features without being blocked by SDK version constraints. It also aligns with the approach used by the code-generated models in the SDK for handling unknown values.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

2.26.16

JDK version used

1.8

Operating System and version

macOs

@shetsa-amzn shetsa-amzn added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 30, 2024
@debora-ito
Copy link
Member

@shetsa-amzn which enum are you referring to, can you point to a Javadoc page?
We usually provide a "asString" attribute for enum cases.

@debora-ito debora-ito added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Aug 30, 2024
@shetsa-amzn
Copy link
Contributor Author

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants