Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-6300

Decimal modulo sometimes returns incorrect results

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0
    • Fix Version/s: Impala 2.12.0
    • Component/s: Backend
    • Labels:

      Description

      The following query returns an incorrect result:

      select cast(11111 as decimal(6,1)) % cast(2 as decimal(8,6))
      

      Result:

      -1.901888
      

      We get this result with both decimal_v1 and decimal_v2.

      Modifying the query by removing one of the 1's has the following effect:

      select cast(1111 as decimal(6,1)) % cast(2 as decimal(8,6))
      

      Result:

      1.000000
      

        Attachments

          Activity

            People

            • Assignee:
              tarasbob Taras Bobrovytsky
              Reporter:
              tarasbob Taras Bobrovytsky
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: