1
有沒有辦法將數字(longtype)作爲行鍵存儲在Cassadra中?行鍵作爲長型
我想執行基於行鍵值的範圍查詢。例如$ list info [12345:]; 。它應該列出所有> = 12345的rowkeys。
有沒有辦法在cassandra中實現這一點?二級索引對我沒有幫助。所以我試圖在這裏存儲列值'ip'作爲rowkey。
數據模型:
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
}];
感謝 Thamizh
對不起。因爲有時候我沒有在郵件列表中得到答案。 – Thamizh