Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-2324

Decimal data sent by Avatica cannot be interpreted by some clients

    XMLWordPrintableJSON

    Details

      Description

      JSON specifies a 'number' data type which does not differentiate between integer and floating-point values. The encoding for JSON numbers is implementation-specific. Libraries such as RapidJSON can treat all non-integer values as 'double' while still being compliant with JSON specifications. As a result, decimal values sent by Phoenix will lose precision on the client side.

      Decimal data should be sent as a string. If it is sent as a number, we cannot be expect that all JSON-spec compliant library will handle it properly.

      ie. Phoenix sends a decimal as a JSON number, but Rapidjson can only extract JSON numbers as integer or double because the C++ language does not have native decimal support.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kliew Kevin Liew
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: