-
Notifications
You must be signed in to change notification settings - Fork 140
Is sorting supported? #99
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
Comments
I try to use solution from issue #24 |
Which GSIs do you have defined? |
And while I'm working on the Spring5 support ( #98 ) - which |
I use spring boot version '1.5.3.RELEASE'. |
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99
Any chance that you can try version |
Unfortunately I can not use Spring 5 :( |
@astetsa Any chance you can provide the output of |
I use gradle
|
I have userId as hash key and creationTimestamp as sorting key. But there are cases when same userId trys to add a record in same time. So I need every row in table has unique id. I try to create the table like this: id as hash key. Then I add global secondary index: userId as hash key and creationTimestamp as range key. But when I try to use findByUserIdOrderByCreationTimestampAsc I catch an exception "Sorting not supported for scan operations". Then I try to create the table like this: userId as hash key, id as sorting key. And I try to use local secondary index instead global: userId as hash key and creationTimestamp as range key. But I catch other exception: "Sorting only possible by [id] for the criteria specified". Where I am mistaken? |
I've solved the problem. It works with the global index. It was necessary to add annotations to the model: @DynamoDBIndexHashKey(globalSecondaryIndexName = "IndexName")
@DynamoDBIndexRangeKey(globalSecondaryIndexNames = {"IndexName"}) |
Thanks for updating the issue. Looks like it's worth to put your finding into the documentation (wiki) Thanks again |
Ya I also observed the use of this leads to the exception for the sorting check
I guess we should put a UNSORTED check here or something likewise . `@Override
|
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99 Followup to 8c3e139 Also getting rid of some JDK9 deprecated warnings on the JDK classes - as those methods exist in JDK8 already.
Not addressing this issue per say with PR #130 but handling the |
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99 Followup to 8c3e139 Also getting rid of some JDK9 deprecated warnings on the JDK classes - as those methods exist in JDK8 already.
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99 Followup to 8c3e139 Also getting rid of some JDK9 deprecated warnings on the JDK classes - as those methods exist in JDK8 already.
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99 Followup to 8c3e139 Also getting rid of some JDK9 deprecated warnings on the JDK classes - as those methods exist in JDK8 already.
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99 Followup to 8c3e139 Also getting rid of some JDK9 deprecated warnings on the JDK classes - as those methods exist in JDK8 already.
@derjust Ahh Thanks ,do let me know when this will be released just upgraded and saw this . |
I have a table with id
And global secondary index with projection type 'key only'
Also I have repository method Now I need have folow method I tried to create second global secondary index by expirationDate and creationTimestamp. But I caught an exception: java.lang.UnsupportedOperationException: Sort not supported for scan expressions I tried modify first global secondary index. I setted projection type as 'include' and set expirationDate as non key attribut. But I caught the same exception. How can I implement needed behavior? Many thanks for considering my request! |
I think I know what the problem is. Let's look at the interface of |
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99
Spring-Data no longer passes in `null` if no sorting order is given by the caller but uses `Sort.unsorted()` which incorrectly causes an Exception. This should also solve #99 Followup to 8c3e139 Also getting rid of some JDK9 deprecated warnings on the JDK classes - as those methods exist in JDK8 already.
Don't suppose there is an example with POJOs and table setup for sorting? Either using 4.x or 5.x? I'm struggling to get anything working due to my poor knowledge of Dynamo! |
@derjust awaiting eagerly on this fix :) can we have this in some minor release Please 🥇 |
@astetsa i tried to follow your case but this case is hitting the ceiling with DynamoDB:
Thus I'm unsure what kind of change you are looking for. |
Hi |
I am sorry if am missing anything, but was this problem addressed? |
Hi, @everyone, |
Repository:
Entity:
Service:
Index on the table: (not sure if created right) No clue what is missing, someone please help or suggest to me any other way to achieve it. Thank you in advance! |
Getting |
I use PagingAndSortingRepository.
And I try to get pageable parameter by request like this:
But when I try to use Page findAll(Pageable pageable) I catch UnsupportedOperationException:
"Sorting not supported for find all scan operations".
Is there any way to sort data? Thanks!
The text was updated successfully, but these errors were encountered: