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

Provide an option for serializing DECIMALs in JSON as plain number instead of scientific notation

    XMLWordPrintableJSON

    Details

      Description

      When using DECIMAL types in Flink SQL along with JSON format, it is quite common to see that some large values are written out as scientific notation. For example:

      Definition: `orderId DECIMAL(20, 0)`

      Input: `{"orderId":454621864049246170}`

      Output (without transformations): `{"orderId":4.5462186404924617E+17}`

      However, values in plain numbers are easier to understand and more convenient for the case shown above. So we can provide a boolean option (say `json.use-plain-decimals`?) to make this behavior tunable.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lmagics Q Kang
                Reporter:
                lmagics Q Kang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: