I am using Cassandra database and want to use cqlsh
to see some specific information of the data stored in it with the composite key format. The data model is like this:
rowkey(username) column1(id) column2(city:<city>) value
Alice 12 city:Boston 100
Tom 13 city:New York 200
Bill 22 state:CA 111
As you can see, the data is stored with a composite key, and the column2
has a pattern:city
or state
(String) + another String
(this may vary). Then in cqlsh
what could I do to see the value
according to column2
with pattern: city
+:
+cityname
? For example, it list all the 'value' with a city:
pattern in column2
?
ps: the schema
CREATE TABLE info (
key text,
column1 bigint,
column2 text,
value bigint,
PRIMARY KEY (key, column1, column2)
) WITH COMPACT STORAGE AND
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={'sstable_compression': 'SnappyCompressor'};