Re: Problems with filters

225 views
Skip to first unread message

Alex P

unread,
Oct 3, 2013, 3:42:42 PM10/3/13
to clojure-...@googlegroups.com, Yodit Stanton
Messages are moderated (after we started getting some spam), so first one did go through, we got both :)

You can't run range queries on top of Partition Key. Since Cassandra is a distributed database, there's no guarantee that partition
keys will be located on the same node. Most likely, they'll be distributed across many nodes. You can use token() operations in order
to run range queries on PK, but that won't give you a desired result unless you're using an ordered partitioner. 

So it's not a bug. I would suggest you to get more familiar with Cassandra Data Model: 

These guides explain what partition keys are and why it's not possible to make range queries with them. In your case, you can lock
the partition key, and run "filtering" query: http://clojurecassandra.info/articles/kv.html#toc_10

Alternatively, you can use range queries on non-primary parts of keys: http://clojurecassandra.info/articles/kv.html#toc_8

Thanks!


On October 3, 2013 at 1:02:38 PM, Yodit Stanton (yodit....@googlemail.com) wrote:

Hi,

I have an indexed float type column that I am having trouble filtering with.

The query (select :table (where :col 10.0)) works fine.

But (select :table (where :col [< 10.0])) gets the following error

InvalidQueryException Only EQ and IN relation are supported on the partition key (unless you use the token() function)  com.datastax.driver.core.ResultSetFuture.convertException (ResultSetFuture.java:307)

Not sure if I am missing something?

Regards,



Yodit
--
You received this message because you are subscribed to the Google Groups "Cassaforte, a Clojure client for Apache Cassandra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-cassan...@googlegroups.com.
To post to this group, send email to clojure-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure-cassandra/95cb7e45-a76c-4397-8bda-118baa336013%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages