To expose this strange behavior, let's first create some data that we can play with.
I have created 3 records: one with a very large negative number (
-2^63), one with a small number, and one with a very large postive number (
Now that we have stored some test data, let's perform a MapReduce query on our test bucket. This query won't do anything except load up the data and return it.
Hmmmm...that doesn't look like our data. Just to make sure that the data is being stored correctly, let's retreive our records from Riak without MapReduce.
2^53, which is much smaller than
2^63, the number we are using. So, when
Store your numbers as strings
Use Erlang for MapReduce
Hopefully, one of these solutions will allow you to store big numbers in Riak and avoid having your data unexpectedly rounded.