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

start key has timestamp of first value RTS-977 #1372

Merged
merged 2 commits into from
Mar 16, 2016

Conversation

andytill
Copy link

Riak TS uses the start key to hash to a vnode and does not take into account the start_inclusive filter.

SELECT * FROM table1 WHERE a = 1 AND b = 1 AND c > 1999 AND c <= 5000;

This query produces a first sub query with a key from 1999..3000, this hashes to the 1999 quantum which will not contain the results from 2000..3000. The result set will have missing objects.

This bug only manifests when using the > operator with a right hand value one less than the quanta boundary.

This change increments the start key by one and removing the {start_inclusive,false} filter when it exists to produce a start key of 2000..3000 in the first sub query, the start key hashes to the vnode where the data is actually stored. Fitler >= is not affected because the right hand value is

andytill added 2 commits March 10, 2016 14:44
@andytill andytill changed the title RTS-977 start key has timestamp of first value RTS-977 Mar 15, 2016
StartKey,
EndKey,
{filter, {'=', {field, <<"weather">>, varchar}, {const, <<"yankee">>}}},
{start_inclusive, false}
{filter, {'=', {field, <<"weather">>, varchar}, {const, <<"yankee">>}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be nice to have a non-optional start_inclusive flag.

@hmmr
Copy link
Contributor

hmmr commented Mar 16, 2016

+1 daaffa5

Posted two comments, but no change in code is expected.

borshop added a commit that referenced this pull request Mar 16, 2016
start key has timestamp of first value RTS-977

Reviewed-by: hmmr
@andytill
Copy link
Author

@borshop merge

@borshop borshop merged commit daaffa5 into riak_ts-develop Mar 16, 2016
@martincox martincox deleted the at-quantum-boundary-queries branch June 14, 2019 09:15
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

Successfully merging this pull request may close these issues.

3 participants