-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fix – sorted limited offset mount queries #124
Merged
Merged
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
42a00bc
mount: add sorting support
Stebalien 0ab21bf
mount: add filter support
Stebalien 32214c5
Update test to account for nested mounts
michaelavila 28e5b7b
Add NaiveLimit solution
michaelavila 7a8c70e
Add another naive solution for offset
michaelavila 2cec99f
Add note for where implementation may need to go
michaelavila 9550a82
Only apply NaiveOffset and NaiveLimit when appropriate
michaelavila 5b4de5b
Fix filters by using NaiveFilter
michaelavila 37e058e
Update mount query test names
michaelavila 1633052
Fix bug with NaiveQueryApply and add corresponding tests
michaelavila d372019
Make new query for children
michaelavila f50f59c
Add more tests
michaelavila b94a623
Run go fmt on mount.go
michaelavila e192b45
Cleanup
michaelavila 18ef644
Remove unnecessary for
michaelavila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Honestly, we could probably switch to the naive filter as well. I'm not sure why I did it this way (well, it'll be slightly faster but not by much).
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.
@Stebalien Actually we're finding that we might have to use the NaiveFilter implementation because if the underlying datastores support filter they're going to be filtering only on the subkey (if they filter on key) meaning they'll exclude their mount prefix. So we probably have to treat filters in the same way we do offsets by stashing them and then removing them from the Query that is passed to each datastore, and then applying them at then end when the keys are full keys. So we're going to do as you suggest here and use NaiveFilter. It reads a little clearer too.
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.
There's a commit that fixes filtering by using
NaiveFilter
: 5b4de5bThere 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.
Ah, good catch. We definitely need to remove the filters from the query we're forwarding. Actually, we should probably just create a new query.