I have a column-family/table in cassandra-3.0.6 which has a column named "value" which is defined as a blob data type.
CQLSH query select * from table limit 2;
returns me:
id | name | value
id_001 | john | 0x010000000000000000
id_002 | terry | 0x044097a80000000000
If I read this value using cqlengine(Datastax Python Driver), I get the output something like:
{'id':'id_001', 'name':'john', 'value': '\x01\x00\x00\x00\x00\x00\x00\x00\x00'}
{'id':'id_002', 'name':'terry', 'value': '\x04@\x97\xa8\x00\x00\x00\x00\x00'}
Ideally the values in the "value" field are 0
and 1514
for row1
and row2
resp.
However, I am not sure how I can convert the "value" field values extracted using cqlengine to 0
and 1514
. I tried few methods like ord()
, decode()
, etc but nothing worked. :(
Questions:
- What is this format?
'\x01\x00\x00\x00\x00\x00\x00\x00\x00'
or'\x04@\x97\xa8\x00\x00\x00\x00\x00'
? - How I can convert these arbitrary values to
0
and1514
?
NOTE: I am using python 2.7.9 on Linux
Any help or pointers would be useful.
Thanks,