feat: multi-attribute support for expression key builder - #3466
Open
drew-berra wants to merge 1 commit into
Open
feat: multi-attribute support for expression key builder#3466drew-berra wants to merge 1 commit into
drew-berra wants to merge 1 commit into
Conversation
Problem: The key builder in the expression package only supported exactly two keys, PK + SK. Following the recently released multi-attribute key pattern for GSIs in DDB, a valid query can now support multiple key conditions (DynamoDB currently supports up to 4 partition key + 4 sort key attributes per GSI). Solution: Update the KeyAnd portion of the expression builder to support multiple keys. Ensure that all but the last key being added are equality, and that the last key is not another KeyAnd expression. Leverage variadic function to maintain backwards compatibility with previous expression building. Testing: make unit + unit test coverage for new behavior Issue: None Reference document: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.DesignPattern.MultiAttributeKeys.html
Contributor
|
Thanks for the contribution. We have some internal work scheduled for this, will wait for leadership decision and come back to you |
Contributor
|
@Madrigal @drew-berra seems like a duplicate for #3292 with a slightly different approach |
Author
|
@raduendv yes I missed that other PR initially. I took a different approach with my change compared to the PR you linked, but I'm happy with whatever path forward the team takes and looking forward to be able to use the key builder for multi attribute keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: The key builder in the expression package only supported exactly two keys, PK + SK. Following the recently released multi-attribute key pattern for GSIs in DDB, a valid query can now support multiple key conditions (DynamoDB currently supports up to 4 partition key + 4 sort key attributes per GSI).
Solution: Update the KeyAnd portion of the expression builder to support multiple keys. Ensure that all but the last key being added are equality, and that the last key is not another KeyAnd expression. Leverage variadic function to maintain backwards compatibility with previous expression building.
Testing: make unit + unit test coverage for new behavior
Issue: None
Reference document: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.DesignPattern.MultiAttributeKeys.html
PLEASE READ BEFORE CONTINUING
DO NOT submit pull requests that directly modify generated source files, e.g.
/service/s3/api_client.go. Generated source files will always include an identifying header:Manual changes to these files will be overwritten by code generation that occurs as part of the daily SDK release process.
DO NOT submit pull requests that directly modify files in the
/codegen/sdk-codegen/aws-modelsfolder. These are API model files, owned by each AWS service team, that are updated automatically as part of the daily SDK release process. Local changes to these files will not persist.If you believe the contents of any of these files need to be changed, please open an issue.
If the PR addresses an existing bug or feature, please reference it here.
This PR adds in support for multi-attribute keys in the ddb expression builder. This is in support of a new DDB feature documented here.
To help speed up the process and reduce the time to merge please ensure that
Allow edits by maintainersis checked before submitting your PR. This will allow the project maintainers to make minor adjustments or improvements to the submitted PR, allow us to reduce the roundtrip time for merging your request.Changelog
Please DO NOT include a changelog entry in your pull request (you may see
what these look like in other PRs submitted directly by SDK team members). We
will take care of this for you.