开发者

Cassandra: Using LongType

I'm trying to insert data into a ColumnFamily with "CompareWith" attribute "LongType". However, when trying to insert data under numerical keys, I get a thrift error.

When attempting the same operation with the cassandra-cli prog开发者_Go百科ram, I get the error "A long is exactly 8 bytes". How can I resolve this? Should I use a different comparison type?

Thanks


the cli can't insert binary data.

there are examples in test/system/test_server.py of inserting Long data in python.


Looks like I need to use http://uk3.php.net/manual/en/function.pack.php to pack the key into an 8-byte binary string


The cassandra-cli program supports functions for the set command. (details from "help set;" in the cli)

With the following schema:

create column family Data 
 with key_validation_class = LongType
 and comparator = LongType
 and default_validation_class = LongType;

I can do the following in the cli

set Data[long(2)][long(22)]=long(1022);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜