Intro
I have a blob column on a Cassandra 1.2 column family, the table is defined as follows:
CREATE TABLE objects (
id text,
obj blob,
PRIMARY KEY (id)
);
The problem:
The problem is that when I need to insert/update the blob column from Python using the cql library, I need to base 16 encode the contents of the column like this:
import cPickle
import cql
...
def save_object(connection, obj):
object['id'] = obj['id']
object['obj'] = cPickle.dumps(obj).encode("hex")
cql_statement = "INSERT INTO objects (id, obj) values (:id, :obj)"
cursor = connection.cursor()
cursor.execute(cql_statement, object)
The question:
Is there a way of executing this query without using the base 16 encoding(string) of the object? The reason for this is to reduce the overhead of sending a base 16 encoded string over the wire instead of plain bytes.
Thank in advance!