Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-11376

Calculator Step Get Only Digits fails on Nulls with Data Type issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Medium
    • Resolution: Fixed
    • Affects Version/s: 5.0.3 GA
    • Fix Version/s: 5.1.0 GA
    • Component/s: Step
    • Story Points:
      2
    • PDI Sub-component:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
    • Sprint Team:
      Pervach

      Description

      When CalculatorMetaFunction was refactored as part of PDI-10968, the return type of GetOnlyDigit was changed to a default of TYPE_INTEGER. The function is returning a string. This causes problems when null values are passed through the step.

      diff --git a/engine/src/org/pentaho/di/trans/steps/calculator/CalculatorMetaFunction.java b/engine/src/org/pentaho/di/trans/steps/calculator/CalculatorMetaFunction.java
      index bbb12c2..7cdd7a3 100644
      — a/engine/src/org/pentaho/di/trans/steps/calculator/CalculatorMetaFunction.java
      +++ b/engine/src/org/pentaho/di/trans/steps/calculator/CalculatorMetaFunction.java
      @@ -327,7 +327,7 @@
      // REMOVE TAB FROM string A
      calcDefaultResultType[CalculatorMetaFunction.CALC_REMOVE_TAB] = ValueMetaInterface.TYPE_STRING;
      // GET ONLY DIGITS FROM string A

      • calcDefaultResultType[CalculatorMetaFunction.CALC_GET_ONLY_DIGITS] = ValueMetaInterface.TYPE_INTEGER;
        + calcDefaultResultType[CalculatorMetaFunction.CALC_GET_ONLY_DIGITS] = ValueMetaInterface.TYPE_STRING;
        // REMOVE DIGITS FROM string A
        calcDefaultResultType[CalculatorMetaFunction.CALC_REMOVE_DIGITS] = ValueMetaInterface.TYPE_STRING;
        // LENGTH OF string A

        Attachments

          Activity

            People

            Assignee:
            alena_khamitsevich Alena Khamitsevich (Inactive)
            Reporter:
            btrost William Trost
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: