0

在文档中找不到任何相关信息。如果是这样,我做错了什么?

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';
4

2 回答 2

1

CONTAINS 运算符只能用于集合列(列表、集合和映射)。对于地图,CONTAINS 应用于地图值。CONTAINS KEY 运算符只能用于映射列并应用于映射键。

来源:http ://cassandra.apache.org/doc/latest/cql/dml.html#select

于 2017-02-22T08:59:58.390 回答
0

CONTAINS关键字仅适用于集合。我期待的功能是LIKE关键字之一

于 2017-02-21T14:57:39.580 回答