-
Notifications
You must be signed in to change notification settings - Fork 3
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
empty Local secondary indices results in error when calling createTableWithIndices #6
Comments
Right, makes sense. I'll get this fixed unless you want to send a PR. I
should also update local dynamo to match the behaviour of AWS, but that's
another repo.
…On Wed., Sep. 14, 2022, 11:17 a.m. John Williams, ***@***.***> wrote:
When using createTableWithIndices to create a table with indices (global
but not local) I get the following error
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'tableInitializer': Invocation of init method
failed; nested exception is
software.amazon.awssdk.services.dynamodb.model.DynamoDbException: LSI list
is empty/invalid (Service: DynamoDb, Status Code: 400, Request ID:
4c1beac5-c3cc-409e-89f9-778c1b2a27d0, Extended Request ID: null)
I believe this could be resolved like this below.
val builder = CreateTableEnhancedRequest.builder()
globalIndices.takeIf { it.isNotEmpty() }?.apply { builder.globalSecondaryIndices(this) }
localIndices.takeIf { it.isNotEmpty() }?.apply { builder.localSecondaryIndices(this) }
val request = builder
.build()
createTable(request)
note: I wasn't able to reproduce my issue with your local tests
—
Reply to this email directly, view it on GitHub
<#6>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG2JSB3W6SG5TLFAXOV7HTV6HUARANCNFSM6AAAAAAQMQVCYE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hey, thanks for the fast response! I tried creating a pr but it looks like I don't have the permissions. Those changes above worked for the repo test, and resolved my issue in my service! |
Turns out this problem was already noticed and a fix suggested in aws/aws-sdk-java-v2#1771 (comment). I've integrated the fix and addressed another shortcoming with projections when creating tables in real DynamoDB. The fix is now available on Jitpack. |
When using createTableWithIndices to create a table with indices (global but not local) I get the following error
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tableInitializer': Invocation of init method failed; nested exception is software.amazon.awssdk.services.dynamodb.model.DynamoDbException: LSI list is empty/invalid (Service: DynamoDb, Status Code: 400, Request ID: 4c1beac5-c3cc-409e-89f9-778c1b2a27d0, Extended Request ID: null)
I believe this could be resolved like this below.
note: I wasn't able to reproduce my issue with your local tests
The text was updated successfully, but these errors were encountered: