As far as I can tell, the problem is that you're not using a partition key
in your query. AFAIK, you always have to use partition key in where clause.
And ALLOW FILTERING option is to let cassandra filter data from the rows it
found using the partition key.

One way to solve it is to make partition_id a timeuuid column and then use
that field in your where query:

    SELECT * FROM b_bank_services.messagepayload WHERE
unixTimestampOf(partition_id) >= 1401544800000 AND
unixTimestampOf(partition_id) <= 1401717600000;

Read more at
http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/timeuuid_functions_r.html


On Thu, Jun 12, 2014 at 3:43 PM, Roshan <codeva...@gmail.com> wrote:

> Hi
>
> Cassandra - 2.0.8
> DataStax driver - 2.0.2
>
> I have create a keyspace and a table with indexes like below.
> CREATE TABLE services.messagepayload (
>   partition_id uuid,
>   messageid bigint,
>   senttime timestamp,
>   PRIMARY KEY (partition_id)
> ) WITH compression =
>     { 'sstable_compression' : 'LZ4Compressor', 'chunk_length_kb' : 64 };
>
> CREATE INDEX idx_messagepayload_senttime ON services.messagepayload
> (senttime);
>
> While I am running the below query I am getting an exception.
>
> SELECT * FROM b_bank_services.messagepayload WHERE senttime>=1401544800000
> AND senttime<=1401717600000 ALLOW FILTERING;
>
> com.datastax.driver.core.exceptions.InvalidQueryException: No indexed
> columns present in by-columns clause with Equal operator
>
> Could someone can explain what's going on? I have create a index to the
> search column, but seems not working.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-query-regarding-indexes-tp7595122.html
> Sent from the cassandra-u...@incubator.apache.org mailing list archive at
> Nabble.com.
>



-- 
*Bulat Shakirzyanov* | Software Alchemist

*a: *about.me/avalanche123
*e:* mallluh...@gmail.com

Reply via email to