aws / aws/aws-sdk-java-v2

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

Open
#5,547 2 comments 0 reactions 0 assignees View on GitHub
feature-request p3
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

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

- [X] 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.