cassandra 1.2
CQL未来似乎会成为cassandra的标准访问方法.
- {
- 'key_value':
- 'apache:ver':'2.0',
- 'apache:docbase':'/var/www',
- 'cassandra:ver':'1.2',
- 'cassandra:seeds':'ip_value'
- }
CQL中 2.0 支持的Column范围查询是通过'..'
- select 'apache'..'apache' from testcf where key = ''
而在CQL 3.0中,改变了写法:
- select * from testcf where key = '' and software > 'apache' and software < 'apache'
这里的software字段名, 则是通过column_aliases来设定的.
创建表的语句是:
- CREATE TABLE testcf (
- key ascii,
- software text,
- param text,
- value text,
- PRIMARY KEY (key, software, param)
- ) WITH COMPACT STORAGE AND
- comment='' AND
- caching='KEYS_ONLY' AND
- read_repair_chance=0.100000 AND
- dclocal_read_repair_chance=0.000000 AND
- gc_grace_seconds=1000 AND
- replicate_on_write='true' AND
- compression={'sstable_compression': 'SnappyCompressor'};
直接通过pycassa创建出来的,似乎有点问题,没有名字,在CQLsh里面, 只能看到column1 column2这样的形式.
阅读(1071) | 评论(0) | 转发(0) |