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

Consider changing arithmetic conversions to produce decimal in more cases

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Impala 2.5.0
    • Impala 2.11.0
    • Frontend

    Description

      The conversion rules for mixing decimals and integers are a little confusing.

      select 10.0 / 3
      

      results in a double because it has a decimal literal and non-decimal literal argument.

      But

      select 10.0 / 3.0
      

      results in a decimal because it has two decimal literal arguments.

      Part of the justification for this is that decimal was significantly slower than double, so we didn't want users to see sudden performance regressions. However, we've since improved decimal performance a lot so we should consider revisiting this behaviour.

      The relevant code is Expr.convertNumericLiteralsFromDecimal()

      Attachments

        Issue Links

          Activity

            People

              tarmstrong Tim Armstrong
              tarmstrong Tim Armstrong
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: