Reputation: 2892
I have following table in cassandra:
create table IF NOT EXISTS sample_table(
col1 int,
col2 int,
col3 int,
primary key(col1,col2)
);
Above table has 640 rows at present. Following query for finding token:
select system.token(col1),col1,col2,col3 from sample_table;
when executed, informs that all rows lies between -9157060164899361011 to 9162265122815852158 token.
Now, this clearly means that there are no records for -9223372036854775808 token.
But, when i am executing below query
select system.token(col1),col1,col2,col3 from sample_table
where token(col1)=-9223372036854775808;
it is giving all 640 rows as answer even though none of the returned rows have token as -9223372036854775808.
Same query when executed for -9223372036854775807 token, return no records at all which is correct.
I have found that, this weird behaviour is only for -9223372036854775808 token.
I am using murmur3partitioner.
If anybody know the reason behind this, please explain.
Upvotes: 1
Views: 228
Reputation: 2430
From Cassandra documentation, it looks like that the minimum token value (minimum long value in Java) is used to mean all the tokens from the ring.
From the official JavaDoc of Cassandra's Java driver:
A range is start-exclusive and end-inclusive. It is empty when start and end are the same token, except if that is the minimum token, in which case the range covers the whole ring (this is consistent with the behavior of CQL range queries).
Upvotes: 1