Closed QuentinFAIDIDE closed 2 years ago
Though it's a very late reply, it might help others who face the same issue. You may do something like the following:
row = {
total_output: ExpressCassandra.datatypes.Long.fromString(mybignum.toString())
};
Hello, I am experiencing overflow issues when using the goog.math.Long type for very large numbers this way:
Which make sense because my number is quite big. But the same integer in the data structure I send with raw nodejs integers to the drivers (represented as frozen lists of objects) does not overflow even though it's most of the time the same as the output value:
The value field of the frozen objects in the list is also a bigint in cassandra. Which makes me wonder why this happens in one but not the other.
The native datastax lib supports setting encodingOptions this way:
But whenever I send bigint using the following:
I get a cryptic apollo error about the standard formatting for bigint in nodejs (number appended with n at the end):
Is there a way to either pass the standard nodejs integer to cassandra to avoid the overflow, or to make the BigInt encoding work ?
Thank you and have a nice day.