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

Consider changing arithmetic conversions to produce decimal in more cases

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Impala 2.5.0
    • Fix Version/s: Impala 2.11.0
    • Component/s: Frontend
    • Labels:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: