Closed AndreasNeuwirth closed 2 years ago
Updated. Do note that now bigint will be denoted by a trailing n
as per the MDN definition of big int
Sorry, it seams I was a bit unclear, I expected it to be cast to a Number like the other int variants.
Bigint and Number are two separate primitives. Bigint represents values, which are too large to be represented by the number primitive. Hence, if you force cast Bigint as Number, you can lose the precision of a BigInt value. Per the official documentation on Bigint
Ah, thanks, should have read the docs more carefully (haven't seen bigint as js type before, to be honest).
That's why I had left it as string. But now Athena-express correctly represents it as type Bigint. The trailing 'n' can seem awkward but its the accurate denotation of bigint.
When the result of a query is converted to Json, columns with datatype
bigint
are converted to a string instead of to a number because the specific case is missing (https://github.com/ghdna/athena-express/blob/master/lib/helpers.js#L224).