Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3832

NPE when decimal cast double

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.16.0
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      sql like:

      select
      cast(Column1 as DOUBLE) + cast(Column2 as DOUBLE) AS "COLUMN5",
      cast(Column3 as DOUBLE) + cast(Column4 as DOUBLE) AS "COLUMN6"
      from TABLE

      The Column1、Column2、Column3、Column4 type is decimal(19,4)

      But it throw npe in decimal cast to double

      then I find in calcite plan it doesn't  deal with null

      /* 24 */ final java.math.BigDecimal inp14_ = current[14] == null ? (java.math.BigDecimal) null : org.apache.calcite.runtime.SqlFunctions.toBigDecimal(current[14]);
      /* 25 */ final double v = inp14_.doubleValue();

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Zhixiong Chen Zhixiong Chen
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: