Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal values are not retrieved properly #14

Open
xdc0 opened this issue Mar 12, 2015 · 2 comments
Open

Decimal values are not retrieved properly #14

xdc0 opened this issue Mar 12, 2015 · 2 comments

Comments

@xdc0
Copy link
Contributor

xdc0 commented Mar 12, 2015

Trying to retrieve a Decimal column will not return the expected data.

On Cassandra, decimal columns are stored as a Buffer, and when it's retrieved by the native driver, it returns a Buffer object - however, when cassanova does the data scrub, it incorrectly transforms the Buffer object back into the decimal value.

Example

This is what I'm storing on my decimal column: 31.8439

And this is what cassanova returns: [0, 0, 0, 4, 4, 219, 231]

@xdc0
Copy link
Contributor Author

xdc0 commented Mar 12, 2015

The scrubber needs to parse every data type individually instead blindly running a JSON.stringify.

@keswanikaran
Copy link
Contributor

Got some time to finally look into this.
Decimal types and Varint are not parsed yet in base driver (https://github.com/jorgebay/node-cassandra-cql).
Saying so I am parsing byte buffer back to decimal. I think we should wait for driver to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants