{"record":{"id":"61e0a00998a717bf","repo":"pentaho/pentaho-kettle","slug":"internal-error-invalid-repartitioning-type-repartitioning","errorCode":null,"errorMessage":"Internal error: invalid repartitioning type: \" + repartitioning","messagePattern":"Internal error: invalid repartitioning type: \" \\+ repartitioning","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java","lineNumber":1345,"sourceCode":"      }\n\n      // Repartitioning happens when the current step is not partitioned, but the next one is.\n      // That means we need to look up the partitioning information in the next step..\n      // If there are multiple steps, we need to look at the first (they should be all the same)\n      //\n      switch ( repartitioning ) {\n        case StepPartitioningMeta.PARTITIONING_METHOD_NONE:\n          noPartitioning( rowMeta, row );\n          break;\n\n        case StepPartitioningMeta.PARTITIONING_METHOD_SPECIAL:\n          specialPartitioning( rowMeta, row );\n          break;\n        case StepPartitioningMeta.PARTITIONING_METHOD_MIRROR:\n          mirrorPartitioning( rowMeta, row );\n          break;\n        default:\n          throw new KettleStepException( \"Internal error: invalid repartitioning type: \" + repartitioning );\n      }\n    } finally {\n      outputRowSetsLock.readLock().unlock();\n    }\n  }\n\n  /**\n   * Copy always to all target steps/copies\n   */\n  private void mirrorPartitioning( RowMetaInterface rowMeta, Object[] row ) {\n    for ( RowSet rowSet : outputRowSets ) {\n      putRowToRowSet( rowSet, rowMeta, row );\n    }\n  }\n\n  private void specialPartitioning( RowMetaInterface rowMeta, Object[] row ) throws KettleStepException {\n    if ( nextStepPartitioningMeta == null ) {\n      // Look up the partitioning of the next step.","sourceCodeStart":1327,"sourceCodeEnd":1363,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/BaseStep.java#L1327-L1363","documentation":"In the repartitioning branch of putRow(), a switch on the step's repartitioning type dispatches to special/mirror partitioning; any unrecognized value hits the default case and throws KettleStepException 'Internal error: invalid repartitioning type: X'. It signals corrupted or out-of-range partitioning metadata, since the type constants (PARTITIONING_METHOD_NONE/SPECIAL/MIRROR) are the only valid values.","triggerScenarios":"putRow()/repartitioning path runs when StepPartitioningMeta's method field holds a value outside the known constants — from programmatically setting an invalid partitioning method, corrupt metadata, or a constant mismatch between plugin and engine versions.","commonSituations":"Custom plugin steps setting partitioning method via a raw integer; .ktr files edited/migrated between Kettle versions; serializing partition metadata incorrectly.","solutions":["Set the partitioning method only via StepPartitioningMeta constants (PARTITIONING_METHOD_NONE, _SPECIAL, _MIRROR).","Reload/re-save the transformation in Spoon to repair corrupted partition metadata.","Align engine and plugin versions so partitioning constant values match.","Guard: check stepPartitioningMeta.getMethod() before executing and reset to NONE if unknown."],"exampleFix":"// before\nstepMeta.setStepPartitioningMeta(new StepPartitioningMeta(99, schema));\n// after\nstepMeta.setStepPartitioningMeta(new StepPartitioningMeta(StepPartitioningMeta.PARTITIONING_METHOD_SPECIAL, schema));","handlingStrategy":"validation","validationCode":"int method = stepMeta.getStepPartitioningMeta().getMethod();\nif (method != StepPartitioningMeta.PARTITIONING_METHOD_NONE\n && method != StepPartitioningMeta.PARTITIONING_METHOD_SPECIAL\n && method != StepPartitioningMeta.PARTITIONING_METHOD_MIRROR) {\n  stepMeta.setStepPartitioningMeta(new StepPartitioningMeta(StepPartitioningMeta.PARTITIONING_METHOD_NONE, null));\n}","typeGuard":null,"tryCatchPattern":"try { putRow(rowMeta, row); }\ncatch (KettleStepException e) { if (e.getMessage().contains(\"invalid repartitioning type\")) { resetPartitioning(stepMeta); } else throw e; }","preventionTips":["Set partitioning methods only via StepPartitioningMeta constants","Re-save legacy transformations in the current Spoon version","Keep plugin and engine dependency versions aligned"],"tags":["kettle","partitioning","internal-error","invalid-enum"],"backgroundTag":"invalid-enum-value","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"}