Vladimir Riha created ZEPPELIN-3972:
---------------------------------------
Summary: Inaccurate result values in UI with BigInt values
Key: ZEPPELIN-3972
URL: https://issues.apache.org/jira/browse/ZEPPELIN-3972
Project: Zeppelin
Issue Type: Bug
Components: front-end
Affects Versions: 0.8.0
Reporter: Vladimir Riha
We are trying to display data from sql table using sql interpreter and found
out that it is not possible to display numbers higher than
Number.MAX_SAFE_INTEGER due to the way how results are being parsed in
frontend. As a result, if we have large number in DB, zeppelin UI will display
it wrong.
In file {{apache-zeppelin/zeppelin-web/src/app/tabledata/tabledata.js }} there
is following piece of code in method {{loadParagraphResult}}
{noformat}
if (!isNaN(valueOfCol = parseFloat(col)) && isFinite(col)) {
col = valueOfCol;
}
{noformat}
The problem is that in JS, following code:
{noformat}
parseFloat("1234567890123456785", 10)
{noformat}
returns {{1234567890123456800}} so the displayed results are not accurate. I
think it should be possible to use e.g. BigInt [1] or maybe even avoid casting
the value to number completely?
[1]
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)