使用cassandra的这种配置:
Connected to Test Cluster at localhost:9161.
[cqlsh 4.0.1 | Cassandra 2.0.1 | CQL spec 3.1.1 | Thrift protocol 19.37.0]
当我尝试做的时候:
ALTER TABLE snpSearch WITH compaction_strategy_class='SizeTieredCompactionStrategy'
我收到此错误:
Bad Request: Unknown property 'compaction_strategy_class'
我知道SizeTieredCompactionStrategy是默认策略,但我还要修改sstables大小,并且:
ALTER TABLE snpSearch WITH compaction_strategy_class='SizeTieredCompactionStrategy' AND compaction_strategy_options:sstable_size_in_mb:10;
给我这个错误:
Bad Request: line 1:116 mismatched input ':' expecting '='
我阅读了cql文档并且应该是正确的,有谁知道可能是什么问题?
由于
答案 0 :(得分:3)
正确的格式是:
ALTER TABLE snpSearch WITH compaction={'class':'SizeTieredCompactionStrategy'};
WITH
命令ALTER
选项的格式描述为here。重要的是:
[...]支持的(和语法)与CREATE TABLE语句[...]
相同
example from the CQL3.1 documentation显示了如何设置压缩和压缩策略。
(经[cqlsh 4.0.1 | Cassandra 2.0.1 | CQL spec 3.1.1 | Thrift protocol 19.37.0]
测试。)