评论Cassandra的键空间,表格,列

dzi*_*iou 3 comments cassandra

在Oracle中,有可能关于表,视图,物化视图或列的注释添加到数据字典中,例如

COMMENT ON COLUMN employees.job_id 
   IS 'abbreviated job title';
Run Code Online (Sandbox Code Playgroud)

当我试图理解名称背后的想法时,我发现这对于测试人员来说特别有用,这些想法不一定是可自行解释的,并且在大型数据库中(超过200个表).

Cassandra有这样的功能吗?

Aru*_*ath 6

您可以使用'with comment'选项

cqlsh:d2> 
cqlsh:d2> create table employee (id int primary key, name text) with comment = 'Employee id and name';
cqlsh:d2> desc table employee;

CREATE TABLE d2.employee (
    id int PRIMARY KEY,
    name text
) WITH bloom_filter_fp_chance = 0.01
    AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'
    AND comment = 'Employee id and name'
    AND compaction = {'min_threshold': '4', 'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32'}
    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';
Run Code Online (Sandbox Code Playgroud)

Cassandra文档