incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul \"LeoNerd\" Evans" <leon...@leonerd.org.uk>
Subject Re: CQL decimal encoding
Date Mon, 24 Feb 2014 18:40:09 GMT
On Mon, 24 Feb 2014 17:51:54 +0000
Ben Hood <0x6e6562@gmail.com> wrote:

> Or in the absence of a spec, just a heads up from other language
> driver implementors as to what approach they've taken.

I reverse-engineered it by using cqlsh to insert lots of known
numerical values, then seeing what the returned binary values came out
as.

If you're interested in comparing, my encode/decode functions are here:

  https://metacpan.org/source/PEVANS/Protocol-CassandraCQL-0.11/lib/Protocol/CassandraCQL/Type.pm#L175

  https://metacpan.org/source/PEVANS/Protocol-CassandraCQL-0.11/lib/Protocol/CassandraCQL/Type.pm#L181

And the unit tests live here:

  https://metacpan.org/source/PEVANS/Protocol-CassandraCQL-0.11/t/02types.t#L111

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Mime
View raw message