Skip to content
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

IN operator and Order By falls back to Scan #292

Open
shemekh opened this issue Dec 15, 2020 · 1 comment
Open

IN operator and Order By falls back to Scan #292

shemekh opened this issue Dec 15, 2020 · 1 comment

Comments

@shemekh
Copy link

shemekh commented Dec 15, 2020

Expected Behavior

I have a paging repository as follows:

public interface PagingMessageLogRepository extends PagingAndSortingRepository<MessageLog, MessageLogId> {
	Page<MessageLog> findByInstanceIdOrderByInsertedDateDesc(Long instanceId, Pageable pageable);
	Page<MessageLog> findByInstanceIdInOrderByInsertedDateDesc(List<Long> instanceId, Pageable pageable);
}

instanceId - Hash key
insertedDate - Range key

Problem is with the second method that uses IN operator.

Actual Behavior

First method works as expected and returns MessageLog objects with provided instanceId. Second method is not working properly and throws error. Surprisingly it falls back to Scan instead of performing Query. Thrown error is: Sorting not supported for scan expressions..

Steps to Reproduce the Problem

  1. Self explanatory based on above sections.

Specifications

  • Spring Data DynamoDB Version: 4.5.7 (2.0)
  • Spring Boot Version: 1.5.15.RELEASE
  • AWS SDK Version: 1.11.892
  • Java Version: 1.8.0_261 - Java HotSpot(TM) 64-Bit Server VM 25.261-b12
  • Platform Details: Windows 10 10.0
@xirupem
Copy link

xirupem commented Jul 21, 2022

@derjust

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants