-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sqllab] query result is not accurate #3188
Comments
Which database is this? Have you tried doing the same query with the database cli? |
@xrmx This is mysql, and I use other clients, it is OK! |
Next step is to try the query in pandas, if it's still wrong here then the issue is in pandas. |
OK , I am not very familiar with python and pandas, but I will have a try. |
This looks like a good start https://stackoverflow.com/a/25030617/4470501 |
Thanks for checking! Maybe is this just javascript? On my browser console |
So is this a bug ? |
That is a weird bug. :/ |
If it's only a visualization bug the sql lab api can cast everything to string? |
Is the value ok in the json ? |
@mistercrunch I use fiddler to get the result json。It seems the value in json is OK。 Although,I set the type of main_order_no filed as VARCHAR in superset, it still doesn't work ! But when I change the field type from BIGINT to VARCHAR in mysql, It can be displayed correctly. |
Seems like a JS/JSON.parse limitation: |
Most simple way to reproduce:
in SQLLab |
here it states that any number longer than 15 digits is going to be imprecise in javascript.
12345678901234567 is "corrected" to 12345678901234568 |
@mistercrunch true, also probably much more fundamental JS stores numbers as double precision 64 bit format IEEE 754 values. (http://www.ecma-international.org/ecma-262/5.1/#sec-8.5) I'm guessing this needs to be wrapped in some kind of string format. |
Seems like this is what this does: |
Notice: this issue has been closed because it has been inactive for 264 days. Feel free to comment and request for this issue to be reopened. |
Make sure these boxes are checked before submitting your issue - thank you!
Superset version
0.18.5
0.17.6
Python version
2.7
Expected results
return the accurate bigint field
Actual results
the last two bits in the bigint is wrong
Steps to reproduce
I use sqllab to query mysql tables. My sql statement is :
select * from ec_order_main where main_order_no = 401501121320267725.
"main_order_no" is the primary key of ec_order_main table,its data type is BIGINT.
Sqllab can find the record,but the 'main_order_no' is 401501121320267700. I expected the "main_order_no" should be "401501121320267725" instead of "401501121320267700".
Am I missing something and how can I address this issue?
The text was updated successfully, but these errors were encountered: