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

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. #296

Open
diyan-gochev-at-ft-dot-com opened this issue May 16, 2022 · 2 comments

Comments

@diyan-gochev-at-ft-dot-com

Expected Behavior

  1. If we have a method findA and A is a hash key
    or
  2. 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.

  1. Define only hash-key, declare method findByA where A is a hash key;
    Scenario 2:
  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
Copy link

xirupem commented Jul 21, 2022

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);

@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