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

Round() is inconsistent for Decimal and Double

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.11.0
    • Impala 3.0
    • Backend
    • None
    • ghx-label-3

    Description

      We round away from zero when rounding decimals:

      select round(cast(-5.55 as decimal(10, 5)), 1);
      
      -5.6

       

      However, we round towards positive infinity for doubles.

      select round(cast(-5.55 as double), 1);
      
      -5.5
      
      select round(cast(5.55 as double), 1);
      
      5.6

       

      This seems inconsistent.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: