user1403310
user1403310

Reputation: 41

Cassandra Cql timeunix range query

I have this query, in my columnfamily all the columns name is a unix timestamp.if i realice this query i have this message:

   SELECT FIRST  10000 '631144800'..'1363176066'   FROM datas where KEY='users';
   Bad Request: range finish must come after start in traversal order

But if i put a 0 before the first date:

   SELECT FIRST  10000 '0631144800'..'1363176066'   FROM datas where KEY='users';

it works, is this a bug?, i don´t know why it doesn´t work in the first query

If the long of the string is less it gave me always the same problem, i tried with 999999999 and gave mi the same error

Upvotes: 1

Views: 209

Answers (1)

Richard
Richard

Reputation: 11110

You need to set your column comparator to LongType so Cassandra does numeric comparisons rather than lexicographic comparisons (the default).

Unfortunately you can't change this on existing data though. You will have to zero pad if you can't rewrite your data.

Upvotes: 1

Related Questions