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

Improve precision derivation for decimal arithmetics

    XMLWordPrintableJSON

Details

    Description

      Currently the precision and scale derivation is not properly for decimal data arithmetics, e.g,

      considering the following example:

      select cast('10.1' as decimal(38, 19)) * cast('10.2' as decimal(38, 19)) from T

      the result is `null`, which may confuses use a lot, because the result is actually not that big.

      The root cause is the precision derivation for the above multiplication is:

      (38, 19) * (38, 19) -> (38, 38)

      So there is no space for integral digits, which leads to null results. 

      Attachments

        Issue Links

          Activity

            People

              icshuo Shuo Cheng
              icshuo Shuo Cheng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: