I create the following Column Family in Cassandra:
CREATE COLUMN FAMILY test with comparator = 'CompositeType(UTF8Type,UTF8Type)' and key_validation_class=UTF8Type;
Now I want to add some data:
set test['a']['b:c'] = 'abc'
set test['a']['b:d'] = 'abd'
set test['a']['e:f'] = 'aef'
set test['a']['e:g'] = 'aeg';
Now I would like to retrieve all rows which have e in its Composite key:
something like:
get test['a']['e:*];
and result should be 'aef' and 'aeg'.
How cli query should look like?
I am not sure about CQL, but with playOrm, if you partitioned by a, you can just do S-SQL(scalable SQL) query of
PARTITIONS alias('a') SELECT alias FROM Table as alias WHERE a.column = 'e';
A partition can have millions of rows.
Anyways, just thought it might help you a bit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With