Skip to content
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

Redash transform integer wrong, like, select 331451557290541101 #2666

Open
guzhenping opened this issue Jul 4, 2018 · 7 comments
Open

Redash transform integer wrong, like, select 331451557290541101 #2666

guzhenping opened this issue Jul 4, 2018 · 7 comments

Comments

@guzhenping
Copy link

guzhenping commented Jul 4, 2018

Execute sql :

select 331451557290541101 

the result: 331,451,557,290,541,120.00, they are not equal.

Redash can not support the type of bigint. l think it's a bug.

Technical details:

  • Redash Version: 4.0.1
  • Browser/OS: chrome
  • How did you install Redash: developer user-defined
@kyoshidajp
Copy link
Member

Hi @guzhenping.

Probably, because the number exceeds the max number which will be able to treat as JSON.

For example select 9007199254740992 returns 9,007,199,254,740,992. But select 9007199254740993 returns 9,007,199,254,740,992.

To fix this, first, parses as a string when making the response and returns it in server-side. Second, parse as a string and display as an integer in client-side.

@rusq
Copy link

rusq commented May 30, 2019

Hitting the same issue on version 7 (obviously because nothing has changed since this issue was discovered)
Screen Shot 2019-05-30 at 12 10 10

@liambinnsconroy
Copy link

Bump. Any update on this? Pretty annoying, our users are getting confused.

@susodapop
Copy link
Contributor

I reproduced this on our preview instance.

@arikfr
Copy link
Member

arikfr commented Apr 23, 2020

Looks like we can address this with https://www.npmjs.com/package/json-bigint. Just need to figure out if there are any performance implications.

@stefafafan
Copy link

stefafafan commented Mar 9, 2021

I will link a workaround for this issue (casting to char) because there seemed to be no comments about it in this issue.

bro , yes working once i cast bigint to char in sql , like SELECT cast(uuid as char(408))
#5012 (comment)

example:

スクリーンショット 2021-03-09 11 34 33

i wonder if there is anyway to fix this issue because casting to char everytime is a bit annoying. 😢 using json-bigint?

@RedBulli
Copy link

RedBulli commented May 21, 2021

Noting here that the above example workaround with char(1000) casting has another issue #5504 when it goes through Redash's query results.

Casting to varchar works well also in that scenario. I.e.
select 10231293870128957129845712908471290341234123412::varchar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants