【问题标题】:row key as long type行键作为长类型
【发布时间】:2011-09-14 22:33:06
【问题描述】:

有没有办法在 Cassadra 中将数字(longtype)存储为行键?

我想根据行键值执行范围查询。例如 $list info[12345:]; .它应该列出所有 >= 12345 的行键。

有没有办法在 cassandra 中完成这个?二级索引对我没有帮助。所以我想在这里将列值“ip”存储为行键。

数据模型:

create keyspace ipinfo with placement_strategy =
'org.apache.cassandra.locator.SimpleStrategy' and strategy_options =  
[{replication_factor:1}];

use rng;

create column family info with comparator = AsciiType
and key_validation_class = UTF8Type
and column_metadata =
[{
    column_name : domain,
    validation_class : UTF8Type,
    index_type : 0,
    index_name : domain_idx},
{
    column_name : ip,
    validation_class : LongType,
    index_type : 0,
    index_name : ip_idx
}];

谢谢 塔米日

【问题讨论】:

  • 对不起。因为有时我没有在邮件列表中得到答复。

标签: cassandra


【解决方案1】:

为了记录,这里是 Cassandra 用户列表中回答此问题的线程:http://comments.gmane.org/gmane.comp.db.cassandra.user/20066

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-16
    • 2019-01-18
    • 2011-11-12
    • 2017-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多