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

Support round(DECIMAL) with non-constant second argument

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Impala 3.0, Impala 2.12.0
    • Fix Version/s: None
    • Component/s: Frontend
    • Labels:
    • Epic Color:
      ghx-label-3

      Description

      Sometimes users want to round to a precision that is data-driven (e.g. using a lookup table). They can't currently do this with decimal. I think we could support this by just using the input decimal type as the output type when the second argument is non-constant.

      select round(l_tax, l_linenumber) from tpch.lineitem limit 5;
      Query: select round(l_tax, l_linenumber) from tpch.lineitem limit 5
      Query submitted at: 2018-09-24 11:03:10 (Coordinator: http://tarmstrong-box:25000)
      ERROR: AnalysisException: round() must be called with a constant second argument.
      

      Motivated by a user trying to do something like this; http://community.cloudera.com/t5/Interactive-Short-cycle-SQL/Impala-round-function-does-not-return-expected-result/m-p/80200#M4906

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                arawat Abhishek Rawat
                Reporter:
                tarmstrong Tim Armstrong
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: