pentaho/pentaho-kettle · error · KettleException

Number of columns passed to Infobright doesn't match the…

Error message

Number of columns passed to Infobright doesn't match the table definition!

What it means

KettleRecordPopulator.populate() validates, on the first row only (when conv == null), that the number of columns in the incoming row metadata equals the number of columns in the BrighthouseRecord built from the target Infobright table. A mismatch means the transformation stream shape doesn't match the target table definition, so it throws this KettleException before initializing converters.

Solutions

  1. Re-open the Infobright loader step mapping and re-select fields to match the current table columns
  2. Alter the target table or the transformation so column counts match
  3. Verify the correct target table is selected in the step dialog
  4. Preview the input rows and compare field count against the table definition

Example fix

// before: stream has 5 fields, table has 6 columns -> KettleException
// after: add the missing field to the step mapping or drop the extra table column
ALTER TABLE target DROP COLUMN unused_col; -- or add the field in the step mapping dialog
Defensive patterns

Strategy: validation

Validate before calling

if (inputRowMeta.size() != targetTableColumns.size()) {
  throw new KettleException("Stream has " + inputRowMeta.size() + " fields; table has " + targetTableColumns.size() + " columns");
}

Try / catch

try { loader.processRow(); } catch (KettleException e) { if (e.getMessage().contains("Number of columns")) { /* realign step mapping with table */ } }

Prevention

When it happens

Trigger: First call to populate() where record.size() != rowMeta.size(): the step's field mapping (selected input fields) count differs from the target table's column count.

Common situations: Target table altered (column added/removed) after the step was configured; input fields added/removed upstream; wrong table selected in the step dialog; wildcard field selection pulling in extra columns.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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

Appendix: source

Thrown at plugins/infobright-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/infobrightoutput/KettleRecordPopulator.java:36

import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMetaInterface;

import com.infobright.etl.model.BrighthouseRecord;
import com.infobright.etl.model.ValueConverterException;

/**
 * @author geoffrey.falk@infobright.com
 */
class KettleRecordPopulator {

  private KettleValueConverter[] conv = null;

  public void populate( BrighthouseRecord record, Object[] row, RowMetaInterface rowMeta ) throws KettleException {

    // assume row metadata is same for all rows
    if ( conv == null ) {
      if ( record.size() != rowMeta.size() ) {
        throw new KettleException( "Number of columns passed to Infobright "
          + "doesn't match the table definition!" );
      }
      init( rowMeta );
    }

    for ( int colidx = 0; colidx < record.size(); colidx++ ) {
      Object value = row[colidx];
      try {
        record.setData( colidx, value, conv[colidx] );
      } catch ( ValueConverterException e ) {
        Throwable cause = e.getCause();
        if ( cause instanceof KettleException ) {
          throw (KettleException) cause;
        } else if ( cause instanceof RuntimeException ) {
          throw (RuntimeException) cause;
        } else if ( cause instanceof Error ) {
          throw (Error) cause;
        } else {

View on GitHub (pinned to f3058517a1)