{"record":{"id":"6489eba080b30511","repo":"pentaho/pentaho-kettle","slug":"number-of-levels-must-be-greater-that-0-to-process-the-rows","errorCode":null,"errorMessage":"Number of levels must be greater that 0 to process the rows","messagePattern":"Number of levels must be greater that 0 to process the rows","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/palo/core/src/main/java/org/pentaho/di/trans/steps/palo/dimoutput/PaloDimOutput.java","lineNumber":58,"sourceCode":"  private ConsolidationCollection consolidations;\n\n  public PaloDimOutput( final StepMeta stepMeta, final StepDataInterface stepDataInterface, final int copyNr,\n                        final TransMeta transMeta, final Trans trans ) {\n    super( stepMeta, stepDataInterface, copyNr, transMeta, trans );\n  }\n\n  public final boolean processRow( final StepMetaInterface smi, final StepDataInterface sdi ) throws KettleException {\n\n    meta = (PaloDimOutputMeta) smi;\n    data = (PaloDimOutputData) sdi;\n\n    Object[] r = getRow();\n\n    if ( first ) {\n      first = false;\n      this.logBasic( \"First Row Analysis:\" );\n      if ( meta.getLevels().size() == 0 ) {\n        throw new KettleException( \"Number of levels must be greater that 0 to process the rows\" );\n      }\n      this.logBasic( \"Number of defined levels: \" + meta.getLevels().size() );\n\n      /* Indexes will follow [data index],[consolidation index],[data index],[consolidation index] .... */\n      data.indexes = new int[meta.getLevels().size() * 2];\n      for ( int i = 0; i < meta.getLevels().size(); i++ ) {\n\n        /* Get data field index */\n        String dataFieldName = meta.getLevels().get( i ).getFieldName();\n        int numRow = getInputRowMeta().indexOfValue( dataFieldName );\n        if ( numRow < 0 ) {\n          throw new KettleException( \"DimOutput: failed to find input row meta for \".concat( meta.getLevels().get( i )\n            .getLevelName() ) );\n        }\n        data.indexes[i * 2] = numRow;\n        this.logDebug( meta.getLevels().get( i ).getLevelName() + \" has index: \" + numRow );\n\n        /* Get consolidation field index */","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/palo/core/src/main/java/org/pentaho/di/trans/steps/palo/dimoutput/PaloDimOutput.java#L40-L76","documentation":"KettleException thrown in PaloDimOutput.processRow during the first-row analysis when the step has no dimension levels configured. The step maps incoming row fields onto Palo dimension levels, so zero configured levels makes processing impossible and the transformation aborts.","triggerScenarios":"The Palo Dim Output step's levels list is empty (meta.getLevels().size() == 0) when the first row arrives: the user never added level mappings in the dialog, or the saved level definitions failed to load (see related readRep/readData errors).","commonSituations":"Freshly added Palo Dim Output step run without configuring levels; transformation XML/repository attributes for levels lost during migration; step copied from another transformation without its level table.","solutions":["Open the Palo Dim Output step dialog and define at least one dimension level (dimension, level, field mapping).","Re-save the transformation to persist the levels.","If levels were configured but not loaded, check for related XML/repository load errors and fix the source file/attributes."],"exampleFix":"// before: step run with empty levels table\n// after: in the dialog add e.g. Dimension 'Year', Level 'Year', Field 'yearField'","handlingStrategy":"validation","validationCode":"// Before executing the transformation, assert levels are configured\nPaloDimOutputMeta meta = (PaloDimOutputMeta) stepMeta.getStepMetaInterface();\nif (meta.getLevels() == null || meta.getLevels().isEmpty()) {\n  throw new IllegalStateException(\"Palo Dim Output step has no levels configured\");\n}","typeGuard":"boolean hasLevels(PaloDimOutputMeta meta) {\n  return meta != null && meta.getLevels() != null && !meta.getLevels().isEmpty();\n}","tryCatchPattern":"try {\n  trans.execute(null);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"Number of levels must be greater\")) {\n    log.error(\"Configure dimension levels in the Palo Dim Output dialog\");\n  }\n}","preventionTips":["Configure at least one level mapping before running the step","Verify level attributes loaded correctly after migrations","Preview the step in Spoon to catch empty config early","Keep level definitions in version control via saved .ktr"],"tags":["configuration","palo","validation","step-config"],"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"}