incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: New SecondaryIndex expression=IndexOperator.LIKE
Date Sat, 04 Jun 2011 05:25:48 GMT
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 <cryptcom@gmail.com> 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 =
> data.metadata().getValueValidator(expression.column_name).compare(column.value(),
> expression.value);
>            if (!satisfies(v, expression.op))
>                return false;
>
> and make it something like this
>
> if (expression.LIKE) {
>  if (!column.MakeItAStringValue().equalsIgnoreCase(express.value))  //this
> would actually fall into a switch for S_LIKE, LIKE_S, S_LIKE_S
>    return false;
> else {
> int v =
> data.metadata().getValueValidator(expression.column_name).compare(column.value(),
> expression.value);
>            if (!satisfies(v, expression.op))
>                return false;
> }
>
> am i on the right track?  smoking crack?
>
> let me know please
>
> /*
> Joe Stein
> http://www.linkedin.com/in/charmalloc
> Twitter: @allthingshadoop
> */
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Mime
View raw message