question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use BigInt lib for returning large numbers

See original GitHub issue

I understand that the LONG datatype can’t be larger than 64bit. It’d be great if you could return a number larger than 64 bit when aggregating numeric datatypes.

Problem description: When calculating the SUM of a LONG field, I get an exception: NotSerializableExceptionWrapper: arithmetic_exception: long overflow

Steps to reproduce: CREATE TABLE testa(aa LONG)

Run this query multiple times: INSERT INTO testa(aa) VALUES (8888888888888888888)

SELECT SUM(aa) FROM testa

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
manikanta-kondeticommented, Jun 4, 2018

I have tried to reproduce the same. Created a table with a attribute values of type lONG & added 150 records of values 9999999999999999. Tried to do an aggregation “SUM” on this particular table and got “ArthimeticException error”. Added the screenshot.

screen shot 2018-06-04 at 5 19 10 pm

Also, I have started working on fixing it by refactoring the code to use BIGINT. I will create a PR soon and will share the link here and we can discuss further.

Look forward

0reactions
seutcommented, Jan 11, 2021

We’ve implemented this by https://github.com/crate/crate/pull/10854, which will be part of the next CrateDB 4.4 feature release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BigInt - JavaScript - MDN Web Docs
BigInt values represent numeric values which are too large to be represented by the ... Returns true if the passed BigInt value is...
Read more >
Handling large numbers in C++? - biginteger - Stack Overflow
It doesn't use any 3rd-party library. I have used this to handle huge numbers (as long as you have enough memory to store...
Read more >
A guide to using BigInt - LogRocket Blog
BigInt gives us the ability to work with large numbers without having to worry about potentially losing precision (digits) or weird ...
Read more >
Using JavaScript BigInt to Represent Large Numbers
To represent integers larger than 2 to the 53rd power minus 1 in JavaScript, we can use the BigInt object to represent the...
Read more >
BigInt (BIG INTEGERS) in C++ with Example - GeeksforGeeks
The following operations are being performed on BigInt-. Defining some big integers. Checking the number of digits in the big integer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found