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

Decimal modulo sometimes returns incorrect results

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0
    • Impala 2.12.0
    • Backend

    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

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

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment