I'm using MessagePack to marshal binary data, and I would like to persist it in Cassandra using Cequel:
require 'msgpack'
class KvIdx
include Cequel::Record
key :k, :text
key :s, :text, order: :asc
column :v, :blob
end
KvIdx.synchronize_schema
KvIdx.create!({
:k => 'foo',
:s => 'bar',
:v => MessagePack.pack '1234'
})
Result:
Cql::QueryError: Invalid STRING constant (�1234) for v of type blob
vendor/bundle/ruby/2.1.0/gems/cql-rb-2.0.1/lib/cql/client/client.rb:545:in `execute'
vendor/bundle/ruby/2.1.0/gems/cequel-1.4.1/lib/cequel/metal/keyspace.rb:178:in `block in execute_with_consistency'