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

JSON_VALUE/QUERY functions incorrectly map floating numbers

Agile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 1.19.1
    • 1.20.0
    • Table SQL / Runtime
    • None

    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

        There are no Sub-Tasks for this issue.

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            dwysakowicz Dawid Wysakowicz
            dwysakowicz Dawid Wysakowicz

            Dates

              Created:
              Updated:

              Slack

                Issue deployment