I'm using composite datatype in rowkey, column family is as below
create column family CompositeTest
with comparator = 'UTF8Type'
and key_validation_class = 'CompositeType(UTF8Type,UTF8Type)'
and default_validation_class = 'UTF8Type';
The sample data of this column family as below,
RowKey: s2:2222222
=> (column=param1, value=value1
=> (column=param2, value=value2
=> (column=param3, value=value3
-------------------
RowKey: s2:3333333
=> (column=param1, value=value1
=> (column=param2, value=value2
=> (column=param3, value=value3
-------------------
RowKey: s2:1111111
=> (column=param1, value=value1
=> (column=param2, value=value2
=> (column=param3, value=value3
-------------------
RowKey: s1:3333333
=> (column=param1, value=value1
=> (column=param2, value=value2
=> (column=param3, value=value3
-------------------
RowKey: s1:2222222
=> (column=param1, value=value1
=> (column=param2, value=value2
=> (column=param3, value=value3
-------------------
RowKey: s1:1111111
=> (column=param1, value=value1
=> (column=param2, value=value2
=> (column=param3, value=value3
I want to get all the rows which first component of row key is "s1". Is it possible using Hector client? if not then by which cassandra client its possible?
I've tried by using following code, but its not working,
Composite start = new Composite();
start.addComponent(0, "s1", ComponentEquality.EQUAL);
Composite end = new Composite();
end.addComponent(0, "s1", ComponentEquality.GREATER_THAN_EQUAL);
RangeSlicesQuery<Composite, String, String> rangeSlicesQuery = HFactory.createRangeSlicesQuery(keyspace, new CompositeSerializer(), StringSerializer.get(), StringSerializer.get());
rangeSlicesQuery.setKeys(start, end);
rangeSlicesQuery.setRange("param1", "param3", false, 100);
rangeSlicesQuery.setColumnFamily("CompositeTest");
rangeSlicesQuery.setRowCount(11);
QueryResult<OrderedRows<Composite, String, String>> queryResult = rangeSlicesQuery.execute();
Rows<Composite, String, String> rows = queryResult.get();
Iterator<Row<Composite, String, String>> rowsIterator = rows.iterator();
Thanks in advance...