cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mehak Mehta <meme...@cs.stonybrook.edu>
Subject Re: 2d or multi dimension range query in cassandra CQL
Date Tue, 17 Mar 2015 20:51:29 GMT
Hi,

In my case I am just trying to do range queries on 2 dimensions i.e. x and
y.

*cqlsh:images> CREATE TABLE images.results1 (uuid uuid,
analysis_execution_id varchar, analysis_execution_uuid uuid, x  double, y
double, submit_date timestamp, points list<double>,  PRIMARY KEY
(image_caseid));*

With secondary indexes on x and y:
*cqlsh:images> create index results1_y on results1(y);*
*cqlsh:images> create index results1_x on results1(x);*

But when I try the following the query it is not allowed with an error.

*cqlsh:images> select * from results1 where image_caseid='mehak' and x >
100 and y <100 allow filtering;*
*code=2200 [Invalid query] message="No indexed columns present in
by-columns clause with Equal operator"*

Can you tell me why this is not working. I can't understand why Cassandra
is not allowing me to use Non EQ range query on secondary indexes even when
I have restricted my primary key by EQ as specified in error message.

Also please elaborate on how to use Lucene/Solr in this case with Cassandra.

Thanks,
Mehak

On Tue, Mar 17, 2015 at 2:26 PM, 健峰 高 <g@beecloud.cn> wrote:

> Lucene or Solr is better. I’m using lucene
>
> 在 2015年3月18日,上午2:11,Jack Krupansky <jack.krupansky@gmail.com> 写道:
>
> 1. Create multiple secondary indexes, one for each non-key column you need
> to index on. Not recommended. Considered an anti-pattern for Cassandra.
> 2. Use DSE Search/Solr.
> 3. Use Lucene-based indexing with TumpleJump/Stargate or Stratio.
>
> -- Jack Krupansky
>
> On Tue, Mar 17, 2015 at 1:49 PM, Mehak Mehta <memehta@cs.stonybrook.edu>
> wrote:
>
>> Hi,
>>
>> I want to perform range queries (as in x and y ranges) on a large data
>> billions of rows.
>> CQL allows me to put Non EQ restrictions on only one of the clustering
>> columns.
>> Its not allowing me to filter the data using any other column even with
>> use of Allow Filtering option.
>>
>> cqlsh:images> *select * from results1 where image_caseid='mehak' and x >
>> 100 and y <100 order by x allow filtering;*
>> *code=2200 [Invalid query] message="No indexed columns present in
>> by-columns clause with Equal operator"*
>>
>> My table definition is :
>>
>> *CREATE TABLE images.results1 (uuid uuid, analysis_execution_id varchar,
>> analysis_execution_uuid uuid, x  double, y double, loc varchar, w double, h
>> double, normalized varchar, type varchar, filehost varchar, filename
>> varchar, image_uuid uuid, image_uri varchar, image_caseid varchar,
>> image_mpp_x double, image_mpp_y double, image_width double, image_height
>> double, objective double, cancer_type varchar,  Area float, submit_date
>> timestamp, points list<double>,  PRIMARY KEY ((image_caseid),x));*
>>
>> Kindly suggest me how to model is data and perform 2d or in general multi
>> dimension range queries in Cassandra efficiently.
>>
>>
>> Thanks,
>> Mehak
>>
>
>
>

Mime
View raw message