0

when I export my query result to json on datagrip 2018.2 , I have my json that contains 1.0E8 instead of 100000000. How can I export my values flat instead of scientific notation automatically formatted by JSON-Groovy?

Else I will have to patch my data manually but I think it is a bit dangerous to format a data like that, especially with a value that won't match an integer type once extracted!

Nicolas D
  • 1,182
  • 18
  • 40
  • [Relevant](https://stackoverflow.com/a/39681707/240443). tl;dr: JSON has no integer type, just number type which is generally expected to correspond to `double`. – Amadan Sep 05 '18 at 09:22

1 Answers1

1

It's a bug and it might be fixed: https://youtrack.jetbrains.com/issue/DBE-7019 Anyway, you can play with the extractor by your own. Scripts are usually located in Scratches and Consoles/Extensions/Database Tools and SQL/data/extractors. Or you can select Go to scripts directory in the extractor menu to navigate there. The problem you've described is likely here:

enter image description here

UPD: Here's the extractor with the fix https://gist.github.com/moscas/793e441b12872b8339a1471966343439#file-json-groovy-withnumbersfix-json-groovy

moscas
  • 9,064
  • 36
  • 42