tuplejump / calliope-release

The repository for the G.A. codebase for Calliope. For the E.A. codebase request an early access to the development repo, http://tuplejump.github.io/calliope/
Apache License 2.0
48 stars 11 forks source link

Support for decimal datatype #8

Open ra2085 opened 10 years ago

ra2085 commented 10 years ago

I already did something like this on my test code to be able to support decimal datatype included in CQL 2.0:

import java.nio.ByteBuffer import org.apache.cassandra.db.marshal.DecimalType import java.math.BigDecimal

implicit def ByteBuffer2BigDecimal(buffer: ByteBuffer): BigDecimal = DecimalType.instance.compose(buffer) implicit def BigDecimal2ByteBuffer(decimal: BigDecimal): ByteBuffer = DecimalType.instance.decompose(decimal)

It works ok, and it would be nice to be included on the next release in the RichByteBuffer implicits. Actually, the rest of the types included in the C* marshal package would be really useful. (date, collections!, boolean, etc.)

Regards!