Hello,
We have a CF with definition below having 3 CompositeTypes (Int, String and String):
create column family AvgTransactions
with comparator = 'CompositeType(org.apache.cassandra.db.marshal.Int32Type,org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)'
and key_validation_class = UTF8Type
and default_validation_class = UTF8Type;
We have data for this CF AvgTransactions as below:
1. set AvgTransactions['1326690000']['1:213:debit']='30,20,10';
2. set AvgTransactions['1326690000']['1:974:credit']='3,2,1';
3. set AvgTransactions['1326690000']['3600:974:credit']='3,2,1';
4. set AvgTransactions['1526690000']['3600:974:debit']='3,2,1';
We would like to search for records which would only return 2 & 3 above. Below is the code. However, we get all 4 records instead.
Composite start = new Composite();
start.addComponent(0, IntegerSerializer.get(),"Int32Type");
start.addComponent("974", StringSerializer.get(), "UTF8Type", AbstractComposite.ComponentEquality.EQUAL);
start.addComponent("credit", StringSerializer.get(), "UTF8Type", AbstractComposite.ComponentEquality.EQUAL);
Composite finish = new Composite();
finish.addComponent(3600, IntegerSerializer.get(),"Int32Type");
finish.addComponent("974", StringSerializer.get(), "UTF8Type", AbstractComposite.ComponentEquality.EQUAL);
finish.addComponent("credit", StringSerializer.get(), "UTF8Type", AbstractComposite.ComponentEquality.EQUAL);
sq.setRange(start, finish, false, 3600);
QueryResult<ColumnSlice<Composite,String>> result2 = sq.execute();
Please let me know if I am missing something in creating the Composite Element for searching based on 2nd and 3rd composite Types.
