When 'findBy' method is annotated with @EnableScan or on class level, and the method uses only hash key (and range key), the method still executes scan instead of query. There is only a check if the used fields are GSI, but no checks if all the fields are hash/range keys.
diyan-gochev-at-ft-dot-com opened this issue · 2 comments
diyan-gochev-at-ft-dot-com commented
Expected Behavior
- If we have a method findA and A is a hash key
or - We have a method findAAndB and A is a hash kay and B is range-key
Query op should be executed.
Actual Behavior
Scan op has been executed.
Steps to Reproduce the Problem
Scenario 1.
- Define only hash-key, declare method findByA where A is a hash key;
Scenario 2: - Define hash key and range key, declare method findAAndB where A is a hash key and B is a range key;
There is only a check if the used fields are GSI, but no checks if all the fields are hash/range keys.
xirupem commented
I'm having the same problem when trying to use a search on the Partition Key, passing a list of elements and using the IN operator.
Eg: Page findAllByHashKeyIn(List hashKeyList, Pageable pageable);