incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Stein <crypt...@gmail.com>
Subject New SecondaryIndex expression=IndexOperator.LIKE
Date Sat, 04 Jun 2011 03:15:30 GMT
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
*/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message