{"record":{"id":"39bed77a23774c2e","repo":"pentaho/pentaho-kettle","slug":"calculator-log-notype-i-1-fieldname-calctypedesc","errorCode":null,"errorMessage":"Calculator.Log.NoType + ( i + 1 ) + \" : \" + fieldName + \" = \" + calcTypeDesc + \" / \" + calcTypeLongDesc","messagePattern":"Calculator\\.Log\\.NoType \\+ \\( i \\+ 1 \\) \\+ \" : \" \\+ fieldName \\+ \" = \" \\+ calcTypeDesc \\+ \" / \" \\+ calcTypeLongDesc","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/calculator/Calculator.java","lineNumber":619,"sourceCode":"            if ( targetMeta.getType() != metaA.getType() || targetMeta.getType() != metaB.getType() ) {\n              dataA = targetMeta.convertData( metaA, dataA );\n              metaA = targetMeta.clone();\n              dataB = targetMeta.convertData( metaB, dataB );\n              metaB = targetMeta.clone();\n            }\n            calcData[index] = ValueDataUtil.remainder( metaA, dataA, metaB, dataB );\n            resultType = targetMeta.getType();\n            break;\n          default:\n            throw new KettleValueException( BaseMessages.getString( PKG, \"Calculator.Log.UnknownCalculationType\" )\n              + fn.getCalcType() );\n        }\n\n        // If we don't have a target data type, throw an error.\n        // Otherwise the result is non-deterministic.\n        //\n        if ( targetMeta.getType() == ValueMetaInterface.TYPE_NONE ) {\n          throw new KettleValueException( BaseMessages.getString( PKG, \"Calculator.Log.NoType\" )\n            + ( i + 1 ) + \" : \" + fn.getFieldName() + \" = \" + fn.getCalcTypeDesc() + \" / \"\n            + fn.getCalcTypeLongDesc() );\n        }\n\n        // Convert the data to the correct target data type.\n        //\n        if ( calcData[index] != null ) {\n          if ( targetMeta.getType() != resultType ) {\n            ValueMetaInterface resultMeta;\n            try {\n              // clone() is not necessary as one data instance belongs to one step instance and no race condition occurs\n              resultMeta = data.getValueMetaFor( resultType, \"result\" );\n            } catch ( Exception exception ) {\n              throw new KettleValueException( \"Error creating value\" );\n            }\n            resultMeta.setConversionMask( fn.getConversionMask() );\n            resultMeta.setGroupingSymbol( fn.getGroupingSymbol() );\n            resultMeta.setDecimalSymbol( fn.getDecimalSymbol() );","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/calculator/Calculator.java#L601-L637","documentation":"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.","triggerScenarios":"calcFields: a CalculatorMetaFunction has a null 'Value type' in its target definition so targetMeta.getType() == ValueMetaInterface.TYPE_NONE.","commonSituations":"Leaving the 'Value type' dropdown empty in the Calculator dialog when adding a calculation; building CalculatorMetaFunction programmatically without setValueType.","solutions":["Set the 'Value type' (e.g. Number, Integer, String, Date) for calculation #N in the Calculator dialog","When constructing meta in code, call setValueType(ValueMetaInterface.TYPE_...) on the function","Re-open and re-save the step so the target metadata is fully populated"],"exampleFix":"// before\nfn.setValueType(ValueMetaInterface.TYPE_NONE); // or left unset\n// after\nfn.setValueType(ValueMetaInterface.TYPE_NUMBER);","handlingStrategy":"validation","validationCode":"if (fn.getValueType() == ValueMetaInterface.TYPE_NONE || fn.getValueType() == -1)\n  throw new IllegalArgumentException(\"Calc #\" + (i+1) + \" has no value type\");","typeGuard":null,"tryCatchPattern":"try { /* calcFields */ } catch (KettleValueException e) { if (e.getMessage().contains(\"NoType\") || e.getMessage().contains(\"no type\")) { /* set the value type for that calc */ } throw e; }","preventionTips":["Never leave the 'Value type' dropdown empty in the Calculator","Set an explicit value type for every calculation, even simple ones","Validate meta before save when constructing CalculatorMeta programmatically"],"tags":["kettle","pdi","calculator","missing-type"],"backgroundTag":"missing-required-config-field","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}