Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Serialization of negative integers & longs fails #111
I am having issues with inserting negative numbers to a column family which is defined with cql 3 just like below:
create table logs
As you can see, I defined "uid" as row key and "ts" as first component of my composite column names.
I am inserting rows to this column family both from cqlsh and Astyanax client. While using Astyanax client, when I set one of the sid, duration and scount columns' values to a negative number, operation throws an exception like printed below:
"com.netflix.astyanax.connectionpool.exceptions.BadRequestException: BadRequestException: [host=127.0.0.1(127.0.0.1):9160, latency=30(47), attempts=1] InvalidRequestException(why:(String didn't validate.) [metanet][logs][1346771673482:scount] failed validation)"
Exception message does not make sense to me. Only the second part of my composite column key is string and why it is invalid when column number is negative?
When I set positive numbers to my sid, duration, scount columns, row is inserted successfully. And also I can insert rows with negative column values via cqlsh and I can query them from Astyanax client and get negative column values successfully.
Here is the code for my insert operation:
MutationBatch m = keyspace.prepareMutationBatch(); long ts = System.currentTimeMillis(); m.withRow( logsCF, 1L ) .putColumn( new LogCK(ts, "scount"), -1 ) .putColumn( new LogCK(ts, "sid"), 1L ) .putColumn( new LogCK(ts, "duration"), 30L ); m.execute();
I could not see what is wrong with my code or column family definition.
My Astyanax version is 1.0.6 and cassandra version is 1.1.2 which is downloaded from DataStax web site.
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
I have similar issue, described here http://stackoverflow.com/questions/13166915/inserting-some-number-values-into-column-family-with-composite-column-fails