You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Renato MarroquĂn Mogrovejo <re...@gmail.com> on 2013/01/17 23:36:00 UTC
Composite Keys Query
Hi all,
I am using some composite keys to get just some specific composite
columns names which I am using as follows:
create column family video_event
with comparator = 'CompositeType(UTF8Type,UTF8Type)'
and key_validation_class = 'UTF8Type'
and default_validation_class = 'UTF8Type';
column_metadata =
[
{column_name: event, validation_class: UTF8Type}
];
The data it contains is as follows:
RowKey: otaner9902:94dd885a-655f-4d5c-adaf-db6a6c51d4ac
=> (column=start:2013-01-17 13:31:05.072, value=, timestamp=1358447465294000)
=> (column=stop:2013-01-17 13:31:05.402, value=2013-01-17
13:31:05.402, timestamp=1358447465402000)
And I am using the following code to retrieve the data:
Composite start = compositeFrom(startArg, Composite.ComponentEquality.EQUAL);
Composite end = compositeFrom(startArg,
Composite.ComponentEquality.GREATER_THAN_EQUAL);
VideoEventCompositeQueryIterator iter =
new VideoEventCompositeQueryIterator("ALL", start,
end, keyspace);
The thing is that I keep on getting zero columns back and I am really
getting to a point that its driving crazy. I have uploaded all my code
to my github account[1] and this specific class is in[2].
Any pointers are more than welcome! Thanks in advance!
Renato M.
[1] https://github.com/renato2099/cassandra12-video-app-hector
[2]https://github.com/renato2099/cassandra12-video-app-hector/blob/master/src/com/killrvideo/BusinessLogic.java