-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
DynamoDBMapper.generateCreateTableRequest() - Forcing ProjectionType.KEYS_ONLY for all LSI #214
Comments
Hi Adao, Not allowing index projection configuration is one of the limitations of the generateCreateTableRequest() method that we explicitly called out in our documentation. The reason that we didn't make the Projection type configuration in the @DynamoDBIndexRangeKey annotation is because we want to avoid index definition in an attribute-level annotation. If we do allow that, then we would need more complicated code to deal with the possible scenario when different attributes reference to the same index but with conflict definition. Also, since @DynamoDBIndexRangeKey is shared by both LSI and GSI, we cannot make the assumption that they will always share the same configuration parameters. It seems that the better way to go is to support index definition in a table-level annotation (e.g. @DynamoDBTable). This will give us more flexibility, and meanwhile keep the attribute-level annotations simple (they only serve as references to the indexes defined somewhere). We will keep thinking about how to carry this out, but right now we don't have an ETA on that. I think currently you can create a simple helper function that processes the generated request and reset the Projection type to the one you want. -Shuo |
Hi Shuo, in understand your points and it's true that this can cause a conflict if different attributes using the same index have different configurations, we can maybe have default fallback in this case. Still in imho I expect something simply like this: @DynamoDBIndexRangeKey( Where we can still have KEYS_ONLY as default. My implementation was a simple overwrite: CreateTableRequest createTableRequest = dynamoDBMapper.generateCreateTableRequest(...); Thanks for your feedback, keep up with the good work! |
I know I might be a little late for the party but I must express how sad it's to not have it implemented by now =/ |
This will be a good feature. |
Is there any chance that this feature will be implemented soon, either on table or attribute level? Thanks in advance! |
@adaofeliz @PauloMigAlmeida @jbuddha @dbubenheim the SDK team has reviewed the feature request list for V1, and since they're concentrating efforts on V2 new features they decided to not implement this one in V1. It's still being considered for the DynamoDB Mapper refactor in V2, see the referenced issue above. I'll go ahead and close this one. Please feel free to comment on the V2 issue with your use case, and reach out if you have further questions. |
Hi,
it seems that it's not possible by using the DynamoDBMapper to create a table with a LSI that protects all the Attributes.
This feature is importante for iteration of the table using the DynamoDBMapper.query().
Why can't this be configurable in the DynamoDBIndexRangeKey Annotation?
I'm more than happy do the change and create a merge request, if you agree to accept it.
Thanks,
Adao
The text was updated successfully, but these errors were encountered: