-
Notifications
You must be signed in to change notification settings - Fork 16
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
Date field sorting #384
Date field sorting #384
Conversation
src/test/java/io/stargate/sgv2/jsonapi/api/v1/FindOperationWithSortIntegrationTest.java
Outdated
Show resolved
Hide resolved
Mostly looks good, but I think this is missing changes to I know that our in-memory sorting is expected to be temporary, and replaced by global sort so this may be acceptable. Now: to fully implement this, |
As per discussion with @tatu-at-datastax, have used PojoNode for Date type. |
This works beautifully since it can be reliably created from |
.hasSize(5) | ||
.isEqualTo( | ||
List.of( | ||
objectMapper.readTree(doc1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend adding another query to this test that sorts in reverse order, and asserts that sorting by new FindOperation.OrderBy("sort_date", false)
returns doc6, doc5, doc4, doc3, doc2. This test as written might succeed even if no sorting was done, because the documents happen to be in ascending order by sort_date
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment but LGTM overall
What this PR does:
Added sorting for date field.
Which issue(s) this PR fixes:
Fixes #374
Checklist