pentaho/pentaho-kettle · error · KettleStepException

Calculator.ErrorInStepRunning

Calculator.ErrorInStepRunning

Error message

Calculator.ErrorInStepRunning

What it means

processRow wraps the per-row calculation logic in a catch for KettleException; when any calculation fails at runtime it logs the message and rethrows a KettleStepException with localized text Calculator.ErrorInStepRunning and the original exception as cause. It is a generic wrapper: the real cause is in the chained exception (e.g. division by zero, type conversion failure inside calcFields).

Solutions

  1. Inspect the cause (e) chain in the stack trace / log for the underlying per-row error
  2. Fix the offending data (e.g. clean non-numeric values with a Data Validator/If-Null step before the Calculator)
  3. Set the step's error handling to route bad rows instead of failing the transformation

Example fix

// before
Calculator -> numeric calc on "amount" (contains 'N/A' strings)
// after
Data Validator / Replace in string (remove non-numeric) -> Calculator
Defensive patterns

Strategy: try-catch

Validate before calling

// sanitize inputs before the Calculator:
// use 'If field value is null' and 'Data Validator' steps to remove bad rows/values

Try / catch

try {
  // run step
} catch (KettleStepException e) {
  logError("Calculator failed: " + e.getMessage(), e); // inspect getCause() for the real per-row error
  setErrors(getErrors() + 1);
}

Prevention

When it happens

Trigger: Any KettleException thrown by calcFields while processing a row (invalid data conversions, arithmetic errors, value type problems) inside processRow's try block.

Common situations: Non-numeric data in a field used by a numeric calculation; null handling errors; downstream issues surfacing as calculation failures on specific rows.

Understand the failure class

Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/82f1b13bf7c9f563. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/calculator/Calculator.java:175

      putRow( data.getOutputRowMeta(), row ); // copy row to possible alternate rowset(s).

      if ( log.isRowLevel() ) {
        logRowlevel( "Wrote row #" + getLinesWritten() + " : " + getInputRowMeta().getString( r ) );
      }
      if ( checkFeedback( getLinesRead() ) ) {
        if ( log.isBasic() ) {
          logBasic( BaseMessages.getString( PKG, "Calculator.Log.Linenr", "" + getLinesRead() ) );
        }
      }
    } catch ( KettleFileNotFoundException e ) {
      if ( meta.isFailIfNoFile() ) {
        logError( BaseMessages.getString( PKG, "Calculator.Log.NoFile" ) + " : " + e.getFilepath() );
        setErrors( getErrors() + 1 );
        return false;
      }
    } catch ( KettleException e ) {
      logError( BaseMessages.getString( PKG, "Calculator.ErrorInStepRunning" + " : " + e.getMessage() ) );
      throw new KettleStepException( BaseMessages.getString( PKG, "Calculator.ErrorInStepRunning" ), e );
    }
    return true;
  }

  /**
   * @param inputRowMeta
   *          the input row metadata
   * @param r
   *          the input row (data)
   * @return A row including the calculations, excluding the temporary values
   * @throws KettleValueException
   *           in case there is a calculation error.
   */
  private Object[] calcFields( RowMetaInterface inputRowMeta, Object[] r ) throws KettleValueException,
          KettleFileNotFoundException {
    // First copy the input data to the new result...
    Object[] calcData = RowDataUtil.resizeArray( r, data.getCalcRowMeta().size() );

View on GitHub (pinned to f3058517a1)