kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Getting error for decimal type data type

Open kkmishra opened this issue 13 years ago • 6 comments

DB Name: Cassandra DB Versions: latest

Feature Description: Support DecimalType with BigDecimal

Currently, it seems that BigDecimals get truncated into integers. It would be nice if BigDecimals could be stored as Cassandra DecimalTypes (decimal in cql).

kkmishra avatar Jan 29 '13 07:01 kkmishra

I tried but not able to reproduce it.

you may want to try, here is available test case:- https://github.com/impetus-opensource/Kundera/blob/trunk/kundera-cassandra/src/test/java/com/impetus/client/crud/datatypes/StudentCassandraTest.java

Thanks Kuldeep

kkmishra avatar Jan 29 '13 07:01 kkmishra

In that example, your BigDecimal is set to 123456789. You use this column definition for the BigDecimal:

{column_name: BIG_DECIMAL, validation_class:IntegerType, index_type: KEYS}

If you use something like 1234.56789, only the value 1234 will be persisted. It would make more sense to use this column definition:

{column_name: BIG_DECIMAL, validation_class:DecimalType, index_type: KEYS}

rramdin avatar Jan 29 '13 14:01 rramdin

Kuldeep, Please verify. I guess this is what we tried as another example:

{column_name: BIG_DECIMAL, validation_class:DecimalType, index_type: KEYS}

-Vivek

mevivs avatar Jan 29 '13 15:01 mevivs

It was an issue. Fixed, please verify.

-Vivek

mevivs avatar Feb 07 '13 18:02 mevivs

Fixed with 2.3.1 patch release.(released today).

mevivs avatar Feb 11 '13 12:02 mevivs

Fixed and releasing with 2.6. Please verify. -Vivek

mevivs avatar Jul 06 '13 19:07 mevivs