Cassandra rangequery, knowing the start of the start key

Let me clarify this

I have a family of columns with such UTF8 keys: apple # NewYork, banana # LosAngeles, banana # NewYork, cherry # NewYork, ... etc.

I need this because they are sorted, and then I would like to get all the banana starting keys?

Is this possible or is there a workaround?

0
source share
1 answer

What about composite types?

Match current rows to columns e.g.

row_key => {banana: a => "the value you want", banana: b => "the value you want", ...}

The benefits of composite types

  • They retain the type property when sorting.
  • a:b:c, a, a: b, , a: b: c

Column Slice , phpcassa :

row_key => { 1:a => 1, 1:b => 1, 10:bb => 1, 1:c => 2}
ColumnSlice(array(1), array(1)) => All Columns with first component equal to 1
ColumnSlice(array(1), array(10)) => All Columns with first component between 1 and 10
ColumnSlice("", array(1, 'c')) => All Columns from the beginning of row whose first component less than 1 and second component less than 'c' 

.

: < x

, , .

+1

All Articles