在文档中找不到有关该信息的任何信息。如果是的话,我做错了什么?
cqlsh:test_keyspace> select * from id_index limit 1;
test_keyspace_id
----------------------------------------
prefix-007
(1 rows)
cqlsh:test_keyspace> select * from id_index where test_keyspace_id contains 'prefix';
test_keyspace_id
---------------
(0 rows)
cqlsh:test_keyspace> describe id_index
CREATE TABLE test_keyspace.id_index (
test_keyspace_id text PRIMARY KEY
) WITH bloom_filter_fp_chance = 0.01
AND caching = '{"keys":"ALL","rows_per_partition":"ALL"}'
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
答案 0 :(得分:1)
CONTAINS运算符只能用于集合列(列表, 集和地图)。在地图的情况下,CONTAINS适用于地图 值。 CONTAINS KEY运算符只能用于地图列和 适用于地图键。
来源:http://cassandra.apache.org/doc/latest/cql/dml.html#select
答案 1 :(得分:0)
CONTAINS
关键字仅适用于集合。我期待的功能是LIKE
关键字