go-ds-s3
go-ds-s3 copied to clipboard
Fix query logic
I've written a query test suite to test all query combination.
This PR currently fixes offset handling but we still need to handle:
- Ordering
- Filtering
Unfortunately, these are non-trivial because we need to handle them in the following order:
- Prefix
- Filter
- Order
- Offset
- Limit
To handle complex orders (i.e., anything other than "sort by key"), we can perform one query that handles 1-2 (prefix/filter) and then applies 3-5 via the naive query logic. However, getting this right is non-trivial.
cc @MichaelMure @ianopolous, @hinshun, @tobowers
Unfortunately, I'm not sure when I'll have time to take this to completion but you should know about these issues/limitations. If any of you have the time/inclination to pick this up, I'd be happy to review a PR (and the query tests are now pretty thorough).
@Stebalien what are the functionality impacts of not having this PR + the additional fixes you mentioned merged in?
- The S3 datastore probably still works for blocks, but may not be safe to use for other records.
- The test suite isn't running so there may be other bugs that we just haven't noticed.