Return-Path: X-Original-To: apmail-cassandra-dev-archive@www.apache.org Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 37A0145FC for ; Sat, 4 Jun 2011 05:26:39 +0000 (UTC) Received: (qmail 4012 invoked by uid 500); 4 Jun 2011 05:26:38 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 3872 invoked by uid 500); 4 Jun 2011 05:26:38 -0000 Mailing-List: contact dev-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list dev@cassandra.apache.org Received: (qmail 3864 invoked by uid 99); 4 Jun 2011 05:26:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 05:26:35 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jbellis@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jun 2011 05:26:28 +0000 Received: by wwa36 with SMTP id 36so1937241wwa.25 for ; Fri, 03 Jun 2011 22:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=o/jb1+7SXDHHusG8dzBg7U/7OquxQBchmbZ1MKMKpNM=; b=cR/fPYyePu4QLCLAryjkA0Sy6MASZ5hWf0ollt+pufOIKyHeJfUAg7MUHRhmg1zjq7 g9nm4ZYw29E9vWq2KLZDJ4VrdAxhVTO/i4iIO0baKDDcwXmqIHa0ixOObNpMm2IrnGIF ipOTWrSw/LiFDn4w8h7D8fVz5ekc26jVDSFro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Y4fUWJJ0W+qjOlh97Lwf2EAx51crrZ8BmUT7nm7sDKoPX9SNpIX/Kdq049Ic01THEO gmjL9fquOrmX3YgHh2uRB7XS5Z35I/ymEeSwMhC7t69isvenLFT4l8SmdXj+W6iZsO6n 6LqDjJ6neZcVuyu8l9+qUsDg5IocKaJlr6dio= Received: by 10.216.143.134 with SMTP id l6mr212421wej.2.1307165168121; Fri, 03 Jun 2011 22:26:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.12.129 with HTTP; Fri, 3 Jun 2011 22:25:48 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Sat, 4 Jun 2011 00:25:48 -0500 Message-ID: Subject: Re: New SecondaryIndex expression=IndexOperator.LIKE To: dev@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I suppose you could do a STARTS WITH but I don't know that it's worth special casing as an operator since you get most of the benefit with just GTE. -1 on a generic LIKE that's mostly no more efficient than paging through manually. On Fri, Jun 3, 2011 at 10:15 PM, Joseph Stein wrote: > Hey folks, I was contemplating having a LIKE type search on Secondary > Indexes. > > LIKE_S, S_LIKE and S_LIKE_S (similiar to LIKE '%eg', 'eg% and '%eg%' > > I am not sure if this has already been discussed or even an existing JIRA= or > maybe something maybe I could contribute myself? > > It looks like the best way to-do this would be to add some additional > properties to IndexExpression so we know we want to-do a LIKE check > > pseudo coding my thoughts taking this from ColumnFamilyStore > > int v =3D > data.metadata().getValueValidator(expression.column_name).compare(column.= value(), > expression.value); > =A0 =A0 =A0 =A0 =A0 =A0if (!satisfies(v, expression.op)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return false; > > and make it something like this > > if (expression.LIKE) { > =A0if (!column.MakeItAStringValue().equalsIgnoreCase(express.value)) =A0/= /this > would actually fall into a switch for S_LIKE, LIKE_S, S_LIKE_S > =A0 =A0return false; > else { > int v =3D > data.metadata().getValueValidator(expression.column_name).compare(column.= value(), > expression.value); > =A0 =A0 =A0 =A0 =A0 =A0if (!satisfies(v, expression.op)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return false; > } > > am i on the right track? =A0smoking crack? > > let me know please > > /* > Joe Stein > http://www.linkedin.com/in/charmalloc > Twitter: @allthingshadoop > */ > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com