Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1391

Some math functions on decimal type may cause compilation error in run-time generated code.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.6.0
    • None
    • None

    Description

      If a query has an expression like the following :

      log((cast(DEC18 as decimal18(18, 9))))

      Drill will hit an compilation error in the run-time generated code.

      org.apache.drill.exec.rpc.RpcException: Screen received stop request sent. Line 189, Column 35: Cannot determine simple type name "BigDecimal" [32dbdc99-a688-45c6-aa8f-50506be4730d].

      The complained code is :

      188: ExtendedMathFunctions$LogDecimal18_eval:

      { 189: double dblval = new BigDecimal(in.value).setScale(in.scale).doubleValue(); 190: 191: out.value = java.lang.Math.log(dblval); 192: }

      The reason of this compilation error is that the function template for those math functions miss fully qualifying the type of "BigDecimal", causing this compilation error.

      Attachments

        Activity

          People

            DrillCommitter DrillCommitter
            jni Jinfeng Ni
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: