pentaho/pentaho-kettle · error · KettleException

IfNull.Log.SelectValueTypesEmpty

Error message

IfNull.Log.SelectValueTypesEmpty

What it means

Message key IfNull.Log.SelectValueTypesEmpty raised in IfNull.processRow: the 'Select value types' list was selected but contains no value types, so the step cannot determine which fields to apply null-replacement masks to and stops with this localized error.

Solutions

  1. Open the If Null step and select at least one value type with its replacement value
  2. If configuring in code, call meta.setValueTypes(...) with non-empty array before adding the step to the transformation
  3. Re-save the transformation after fixing so the repository record is updated

Example fix

// before
meta.setSelectValuesType(true); // no types
// after
meta.setSelectValuesType(true);
meta.setValueTypes(new IfNullValueType[] { new IfNullValueType("Number", "0", null) });
Defensive patterns

Strategy: validation

Validate before calling

IfNullValueType[] vts = meta.getValueTypes(); if (vts == null || vts.length == 0) throw new IllegalStateException("No value types selected");

Type guard

boolean hasValueTypes(IfNullMeta m) { return m.getValueTypes() != null && m.getValueTypes().length > 0; }

Try / catch

try { trans.execute(null); } catch (KettleException e) { if (e.getMessage().contains("SelectValueTypesEmpty")) { fixStepConfig(); } else { throw e; } }

Prevention

When it happens

Trigger: processRow with meta.isSelectValuesType() true and meta.getValueTypes() == null || length == 0.

Common situations: Step saved without selecting any value types; configuration lost during XML/repository load; step built programmatically without setValueTypes(); selected type list emptied after an upgrade migration.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/ifnull/IfNull.java:142

            data.defaultMasks[i] = environmentSubstitute( meta.getValueTypes()[i].getTypereplaceMask() );
            data.setEmptyString[i] = meta.getValueTypes()[i].isSetTypeEmptyString();
          }

          HashSet<Integer> fieldsSelectedIndex = new HashSet<Integer>();
          for ( int i = 0; i < data.outputRowMeta.size(); i++ ) {
            ValueMetaInterface fieldMeta = data.outputRowMeta.getValueMeta( i );
            if ( data.ListTypes.containsKey( fieldMeta.getTypeDesc() ) ) {
              fieldsSelectedIndex.add( i );
            }
          }
          data.fieldnrs = new int[fieldsSelectedIndex.size()];
          List<Integer> entries = new ArrayList<Integer>( fieldsSelectedIndex );
          Integer[] fieldnr = entries.toArray( new Integer[entries.size()] );
          for ( int i = 0; i < fieldnr.length; i++ ) {
            data.fieldnrs[i] = fieldnr[i];
          }
        } else {
          throw new KettleException( BaseMessages.getString( PKG, "IfNull.Log.SelectValueTypesEmpty" ) );
        }

      } else {
        data.realReplaceByValue = environmentSubstitute( meta.getReplaceAllByValue() );
        data.realconversionMask = environmentSubstitute( meta.getReplaceAllMask() );
        data.realSetEmptyString = meta.isSetEmptyStringAll();

        // Consider all fields in input stream
        data.fieldnrs = new int[data.outputRowMeta.size()];
        for ( int i = 0; i < data.outputRowMeta.size(); i++ ) {
          data.fieldnrs[i] = i;
        }
      }
      data.fieldnr = data.fieldnrs.length;
    } // end if first

    try {
      updateFields( r );

View on GitHub (pinned to f3058517a1)