incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcelo Elias Del Valle <mvall...@gmail.com>
Subject composite keys criteria
Date Thu, 27 Sep 2012 19:47:52 GMT
I know this is a basic question, but find the answer is being harder than I
thought.

Assuming a s composite of 3 Strings, and my columns look like:

A:A:A
A:B:B
A:B:C
A:C:B
B:A:A
B:B:A
B:B:B
C:A:B


Can I search for all the columns where the last component is C, whatever
exists on components 0 and 1? Would the following code do the job?


Composite start = new Composite();
start.addComponent(2, "C", Composite.ComponentEquality.EQUAL);

Composite end = new Composite();
end.addComponent(2, "C", Composite.ComponentEquality.EQUAL);


Or the following?

Composite start = new Composite();
start.addComponent(0, "A", Composite.ComponentEquality.EQUAL);
start.addComponent(1, "A", Composite.ComponentEquality.EQUAL);
start.addComponent(2, "A", Composite.ComponentEquality.EQUAL);

Composite end = new Composite();
end.addComponent(0, "B", Composite.ComponentEquality.GREATER_THAN_EQUAL);
end.addComponent(1, "B", Composite.ComponentEquality.GREATER_THAN_EQUAL);
end.addComponent(2, "B", Composite.ComponentEquality.EQUAL);



-- 
Marcelo Elias Del Valle
http://mvalle.com - @mvallebr

Mime
View raw message