Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-35696

JSON_VALUE/QUERY functions incorrectly map floating numbers

    XMLWordPrintableJSON

Details

    Description

      SELECT JSON_VALUE('{"bigNumber":123456789.987654321}', '$.bigNumber')
      

      produces

      "1.2345678998765433E8"
      

      which can not be mapped back. It gets rounded.

      The reason is we use double for floats in SqlJsonUtils. We should rather configure jackson to use BigDecimals. In order to do that we need to properly shade jayway though.

      I suggest we:

      1. Add com.jayway.jsonpath:son-path to flink-shaded
      2. We use the shaded library and pass a configured mapper which maps floats to BigDecimal

      Attachments

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              dwysakowicz Dawid Wysakowicz
              dwysakowicz Dawid Wysakowicz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: