pentaho/pentaho-kettle · error · KettleValueException

Calculator.Log.NoType + ( i + 1 ) + " : " + fieldName + " =…

Error message

Calculator.Log.NoType + ( i + 1 ) + " : " + fieldName + " = " + calcTypeDesc + " / " + calcTypeLongDesc

What it means

After computing a calculation, the target value type must be set; if targetMeta.getType() is TYPE_NONE (no data type determined), the result would be non-deterministic, so calcFields throws KettleValueException listing calculation number, field name, calc type description and long description. Calculator requires every calculation to have an explicit target type.

Solutions

  1. Set the 'Value type' (e.g. Number, Integer, String, Date) for calculation #N in the Calculator dialog
  2. When constructing meta in code, call setValueType(ValueMetaInterface.TYPE_...) on the function
  3. Re-open and re-save the step so the target metadata is fully populated

Example fix

// before
fn.setValueType(ValueMetaInterface.TYPE_NONE); // or left unset
// after
fn.setValueType(ValueMetaInterface.TYPE_NUMBER);
Defensive patterns

Strategy: validation

Validate before calling

if (fn.getValueType() == ValueMetaInterface.TYPE_NONE || fn.getValueType() == -1)
  throw new IllegalArgumentException("Calc #" + (i+1) + " has no value type");

Try / catch

try { /* calcFields */ } catch (KettleValueException e) { if (e.getMessage().contains("NoType") || e.getMessage().contains("no type")) { /* set the value type for that calc */ } throw e; }

Prevention

When it happens

Trigger: calcFields: a CalculatorMetaFunction has a null 'Value type' in its target definition so targetMeta.getType() == ValueMetaInterface.TYPE_NONE.

Common situations: Leaving the 'Value type' dropdown empty in the Calculator dialog when adding a calculation; building CalculatorMetaFunction programmatically without setValueType.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

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

            if ( targetMeta.getType() != metaA.getType() || targetMeta.getType() != metaB.getType() ) {
              dataA = targetMeta.convertData( metaA, dataA );
              metaA = targetMeta.clone();
              dataB = targetMeta.convertData( metaB, dataB );
              metaB = targetMeta.clone();
            }
            calcData[index] = ValueDataUtil.remainder( metaA, dataA, metaB, dataB );
            resultType = targetMeta.getType();
            break;
          default:
            throw new KettleValueException( BaseMessages.getString( PKG, "Calculator.Log.UnknownCalculationType" )
              + fn.getCalcType() );
        }

        // If we don't have a target data type, throw an error.
        // Otherwise the result is non-deterministic.
        //
        if ( targetMeta.getType() == ValueMetaInterface.TYPE_NONE ) {
          throw new KettleValueException( BaseMessages.getString( PKG, "Calculator.Log.NoType" )
            + ( i + 1 ) + " : " + fn.getFieldName() + " = " + fn.getCalcTypeDesc() + " / "
            + fn.getCalcTypeLongDesc() );
        }

        // Convert the data to the correct target data type.
        //
        if ( calcData[index] != null ) {
          if ( targetMeta.getType() != resultType ) {
            ValueMetaInterface resultMeta;
            try {
              // clone() is not necessary as one data instance belongs to one step instance and no race condition occurs
              resultMeta = data.getValueMetaFor( resultType, "result" );
            } catch ( Exception exception ) {
              throw new KettleValueException( "Error creating value" );
            }
            resultMeta.setConversionMask( fn.getConversionMask() );
            resultMeta.setGroupingSymbol( fn.getGroupingSymbol() );
            resultMeta.setDecimalSymbol( fn.getDecimalSymbol() );

View on GitHub (pinned to f3058517a1)