Cassandra: Using LongType

I am trying to insert data into ColumnFamily with the attribute "CompareWith" "LongType". However, when I try to insert data under numeric keys, I get an economical error.

When I try to perform the same operation with the cassandra-cli program, I get the error message "A long is just 8 bytes". How can i solve this? Should I use a different type of comparison?

thanks

+4
source share
3 answers

cli cannot insert binary data.

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

+1
source

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

+1
source

Cassandra-cli supports the functions of the set command. (details from "help set;" in cli)

With the following diagram:

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

I can do the following in cli

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

Source: https://habr.com/ru/post/1307189/


All Articles