You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The method cast_to_cql in lib/cassandra-cql/statement.rb:112
the conversion ruby escape(obj.unpack('H*')[0]) produces a string containing a hex number. Cassandra 2.0 requires a hex number 0x... when inserting a blob.
The referenced method:
defself.cast_to_cql(obj)ifobj.kind_of?(Array)obj.map{ |member| cast_to_cql(member)}elsifobj.kind_of?(Hash)objelsifobj.kind_of?(Numeric)objelsifobj.kind_of?(Date)obj.strftime('%Y-%m-%d')elsifobj.kind_of?(Time)(obj.to_f * 1000).to_ielsifobj.kind_of?(SimpleUUID::UUID)objelsifobj.kind_of?(TrueClass)orobj.kind_of?(FalseClass)obj# There are corner cases where this is an invalid assumption but they are extremely rare.# The alternative is to make the user pack the data on their own .. let's not do that until we have toelsifobj.kind_of?(String)andUtility.binary_data?(obj)escape(obj.unpack('H*')[0])elseRUBY_VERSION >= "1.9" ? escape(obj.to_s.dup.force_encoding('ASCII-8BIT')) : escape(obj.to_s.dup)endend
The text was updated successfully, but these errors were encountered:
When I try to INSERT data as blob the adapter fails due to an incompatibility which is described here:
http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/blob_r.html
The method cast_to_cql in lib/cassandra-cql/statement.rb:112
the conversion
ruby escape(obj.unpack('H*')[0])
produces a string containing a hex number. Cassandra 2.0 requires a hex number 0x... when inserting a blob.The referenced method:
The text was updated successfully, but these errors were encountered: