{"record":{"id":"28386c2ec4cfa7e0","repo":"pentaho/pentaho-kettle","slug":"number-of-columns-passed-to-infobright-doesn-t-match-the","errorCode":null,"errorMessage":"Number of columns passed to Infobright doesn't match the table definition!","messagePattern":"Number of columns passed to Infobright doesn't match the table definition!","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/infobright-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/infobrightoutput/KettleRecordPopulator.java","lineNumber":36,"sourceCode":"import org.pentaho.di.core.row.RowMetaInterface;\nimport org.pentaho.di.core.row.ValueMetaInterface;\n\nimport com.infobright.etl.model.BrighthouseRecord;\nimport com.infobright.etl.model.ValueConverterException;\n\n/**\n * @author geoffrey.falk@infobright.com\n */\nclass KettleRecordPopulator {\n\n  private KettleValueConverter[] conv = null;\n\n  public void populate( BrighthouseRecord record, Object[] row, RowMetaInterface rowMeta ) throws KettleException {\n\n    // assume row metadata is same for all rows\n    if ( conv == null ) {\n      if ( record.size() != rowMeta.size() ) {\n        throw new KettleException( \"Number of columns passed to Infobright \"\n          + \"doesn't match the table definition!\" );\n      }\n      init( rowMeta );\n    }\n\n    for ( int colidx = 0; colidx < record.size(); colidx++ ) {\n      Object value = row[colidx];\n      try {\n        record.setData( colidx, value, conv[colidx] );\n      } catch ( ValueConverterException e ) {\n        Throwable cause = e.getCause();\n        if ( cause instanceof KettleException ) {\n          throw (KettleException) cause;\n        } else if ( cause instanceof RuntimeException ) {\n          throw (RuntimeException) cause;\n        } else if ( cause instanceof Error ) {\n          throw (Error) cause;\n        } else {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/infobright-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/infobrightoutput/KettleRecordPopulator.java#L18-L54","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-open the Infobright loader step mapping and re-select fields to match the current table columns","Alter the target table or the transformation so column counts match","Verify the correct target table is selected in the step dialog","Preview the input rows and compare field count against the table definition"],"exampleFix":"// before: stream has 5 fields, table has 6 columns -> KettleException\n// after: add the missing field to the step mapping or drop the extra table column\nALTER TABLE target DROP COLUMN unused_col; -- or add the field in the step mapping dialog","handlingStrategy":"validation","validationCode":"if (inputRowMeta.size() != targetTableColumns.size()) {\n  throw new KettleException(\"Stream has \" + inputRowMeta.size() + \" fields; table has \" + targetTableColumns.size() + \" columns\");\n}","typeGuard":null,"tryCatchPattern":"try { loader.processRow(); } catch (KettleException e) { if (e.getMessage().contains(\"Number of columns\")) { /* realign step mapping with table */ } }","preventionTips":["Re-open step mappings after altering the target table","Avoid wildcard field selection when table schemas are strict","Preview rows and compare counts with the table DDL before running","Freeze schema changes and transformation edits together"],"tags":["kettle","schema","infobright","column-count"],"backgroundTag":"schema-validation-failed","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"}