Skip to content

IN operator and Order By falls back to Scan #292

@shemekh

Description

@shemekh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions