Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00F1A921E for ; Tue, 11 Oct 2011 21:06:55 +0000 (UTC) Received: (qmail 82966 invoked by uid 500); 11 Oct 2011 21:06:52 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 82941 invoked by uid 500); 11 Oct 2011 21:06:52 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 82927 invoked by uid 99); 11 Oct 2011 21:06:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 21:06:52 +0000 X-ASF-Spam-Status: No, hits=4.0 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sdolgy@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ey0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2011 21:06:46 +0000 Received: by eyg24 with SMTP id 24so39053eyg.31 for ; Tue, 11 Oct 2011 14:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=eLIHgPgjpJGEKlqWNgKjD8itJjkkbbrN1KSZHESUcHk=; b=cAMHg2v/9MSLT+Q/BfIoEgrxLiRjAdIgJo4sXyiFF/nc9HKeMV54jTw4euODgHxZo9 +4AwhI6CTvpwHjsua4JVq3wcIsCDmnddQcnWDnlqExUVAw8LvLbZmoJxGtPMBz13yxLJ 5GcKuIRNBwcpW09Eo8EJumTY6mstLDvcYl59w= Received: by 10.14.23.7 with SMTP id u7mr2364541eeu.223.1318367185142; Tue, 11 Oct 2011 14:06:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.187.6 with HTTP; Tue, 11 Oct 2011 14:06:05 -0700 (PDT) In-Reply-To: References: From: Sasha Dolgy Date: Tue, 11 Oct 2011 23:06:05 +0200 Message-ID: Subject: Re: Operator on secondary indexes in 0.8.x (GTE/LTE) To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e6d784a5c1024904af0c47b4 --0016e6d784a5c1024904af0c47b4 Content-Type: text/plain; charset=ISO-8859-1 ah, hadn't even thought of that. simple. elegant. cheers. On Tue, Oct 11, 2011 at 11:01 PM, Jake Luciani wrote: > This hasn't changed in AFAIK, In Brisk we had the same problem in CFS so > we created a sentinel value that all rows shared then it works. > CASSANDRA-2915 should fix it. > > On Tue, Oct 11, 2011 at 4:48 PM, Sasha Dolgy wrote: > >> I was trying to get a range of rows based on a secondary_index that was >> defined. Any rows where age was greater than or equal to ... it didn't >> work. Is this a continued limitation? Did a quick look in JIRA, couldn't >> find anything. >> >> The output from "help get;" on the cli contains the following, which led >> me to believe it was a limitation on Cassandra 0.7.x and not on 0.8.x ... >> >> get where [ >> and and ...] [limit ]; >> get where () [ >> and and ...] [limit ]; >> >> - operator: Operator to test the column value with. Supported operators >> are >> =, >, >=, <, <= . >> >> In Cassandra 0.7 at least one = operator must be present. >> >> [default@sdo] get user where age >= 18; >> No indexed columns present in index clause with operator EQ >> [default@sdo] get user where gender = 1 and age >= 18 >> (returns results) >> >> Tested this behavior on 0.8.2, 0.8.6 and now 0.8.7 ... >> >> create column family user >> with column_type = 'Standard' >> and comparator = 'UTF8Type' >> and default_validation_class = 'BytesType' >> and key_validation_class = 'BytesType' >> and memtable_operations = 0.24843749999999998 >> and memtable_throughput = 53 >> and memtable_flush_after = 1440 >> and rows_cached = 0.0 >> and row_cache_save_period = 0 >> and keys_cached = 200000.0 >> and key_cache_save_period = 14400 >> and read_repair_chance = 1.0 >> and gc_grace = 864000 >> and min_compaction_threshold = 4 >> and max_compaction_threshold = 32 >> and replicate_on_write = true >> and row_cache_provider = 'ConcurrentLinkedHashCacheProvider' >> and column_metadata = [ >> {column_name : 'gender', >> validation_class : LongType, >> index_name : 'user_gender_idx', >> index_type : 0}, >> {column_name : 'year', >> validation_class : LongType, >> index_name : 'user_year_idx', >> index_type : 0}]; >> >> >> >> -- >> Sasha Dolgy >> sasha.dolgy@gmail.com >> > > > > -- > http://twitter.com/tjake > -- Sasha Dolgy sasha.dolgy@gmail.com --0016e6d784a5c1024904af0c47b4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ah, hadn't even thought of that. =A0simple. =A0elegant. =A0

cheers.

On Tue, Oct 11, 2011 at 1= 1:01 PM, Jake Luciani <jakers@gmail.com> wrote:
This hasn't changed in AFAIK, =A0In Bri= sk we had the same problem in CFS so we created a=A0sentinel=A0value that a= ll rows shared then it works. CASSANDRA-2915 should fix it.

On Tue, Oc= t 11, 2011 at 4:48 PM, Sasha Dolgy <sdolgy@gmail.com> wrote:<= br>
I was trying to get a range of rows bas= ed on a secondary_index that was defined. =A0Any rows where age was greater= than or equal to ... it didn't work. =A0Is this a continued limitation= ? =A0Did a quick look in JIRA, couldn't find anything. =A0

The output from "help get;" on the cli contai= ns the following, which led me to believe it was a limitation on Cassandra = 0.7.x and not on 0.8.x ...=A0

get <cf> = where <col> <operator> <value> [
=A0 =A0 and <col> <operator> <value> and ...] [limit= <limit>];
get <cf> where <col> <operator>= ; <function>(<value>) [
=A0 =A0 and <col> <o= perator> <function> and ...] [limit <limit>];

- operator: Operator to test the column valu= e with. Supported operators are
=A0 =3D, >, >=3D, <, <= ;=3D .

=A0 In Cassandra 0.7 at least one =3D opera= tor must be present.

[default@sdo] =A0get user where age >=3D 18;=A0
No indexed columns present in index clause with operator EQ
[default@sdo]=A0 get user where gender =3D 1 and age >=3D 18=
(returns results)

Tested this behavior on 0.8.2, 0= .8.6 and now 0.8.7 ...=A0

create column famil= y user
=A0 with column_type =3D 'Standard'
=A0 = and comparator =3D 'UTF8Type'
=A0 and default_validation_class =3D 'BytesType'
=A0= and key_validation_class =3D 'BytesType'
=A0 and memtabl= e_operations =3D 0.24843749999999998
=A0 and memtable_throughput = =3D 53
=A0 and memtable_flush_after =3D 1440
=A0 and rows_cached = =3D 0.0
=A0 and row_cache_save_period =3D 0
=A0 and key= s_cached =3D 200000.0
=A0 and key_cache_save_period =3D 14400
=A0 and read_repair_chance =3D 1.0
=A0 and gc_grace =3D 864000
=A0 and min_compaction_threshold= =3D 4
=A0 and max_compaction_threshold =3D 32
=A0 and = replicate_on_write =3D true
=A0 and row_cache_provider =3D 'C= oncurrentLinkedHashCacheProvider'
=A0 and column_metadata =3D [
=A0 =A0 {column_nam= e : 'gender',
=A0 =A0 validation_class : LongType,
<= div>=A0 =A0 index_name : 'user_gender_idx',
=A0 =A0 index= _type : 0},
=A0 =A0 {column_name : 'year',
=A0 =A0 va= lidation_class : LongType,
=A0 =A0 index_name : 'user_year_id= x',
=A0 =A0 index_type : 0}];



--
Sasha Dolgy
sasha.dolgy@gmail.com



--
http://twitter.com/tjake



--
Sasha Dolgy<= br>sasha.dolgy@g= mail.com
--0016e6d784a5c1024904af0c47b4--