{"record":{"id":"3dcd8ab598ff445f","repo":"pentaho/pentaho-kettle","slug":"failed-to-add-row-to-the-row-buffer","errorCode":null,"errorMessage":"Failed to add row to the row buffer","messagePattern":"Failed to add row to the row buffer","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":148,"sourceCode":"                child = this.consolidations.getConsolidationElement( elementName );\n              }\n\n              if ( parent != null ) {\n                parent.addChild( child, consolidation_factor );\n              }\n            }\n\n            parent = child;\n          }\n        }\n\n        // Should probably make this a parameter on the dialog\n        if ( data.elementNamesBatch.size() % 100 == 0 ) {\n          commitBatch();\n        }\n\n      } catch ( Exception e ) {\n        throw new KettleException( \"Failed to add row to the row buffer\", e );\n      }\n    }\n\n    // this also waits for a previous step to be finished.\n    if ( r == null ) { // no more input to be expected...\n      try {\n        if ( data.elementNamesBatch.size() > 0 ) {\n          commitBatch();\n        }\n\n        // Because we add rows in bulk, the dimension cache isn't complete. It only keeps a list\n        // of added items for validation. If the cache must be pre-loaded, pre-load it now.\n        data.helper.clearDimensionCache();\n        data.helper.loadDimensionCache( meta.getDimension(), meta.getEnableElementCache(), meta\n          .getPreloadElementCache() );\n\n        // if it's the last row create the dimension\n        this.logBasic( \"All rows have been added. Looking for consolidations\" );","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/palo/core/src/main/java/org/pentaho/di/trans/steps/palo/dimoutput/PaloDimOutput.java#L130-L166","documentation":"While processing each input row the step adds element names/rows to an internal batch buffer inside a try block; any exception there (e.g. from the Palo helper adding elements or the element lookup) is wrapped as 'Failed to add row to the row buffer'. Every 100 buffered rows it commits via commitBatch().","triggerScenarios":"An exception is thrown while adding a row's element data to the batch: element type/format mismatch with the Palo dimension, null or malformed values for a level, or a Palo connection error mid-batch.","commonSituations":"Incoming field value doesn't match the level's configured field type; nulls fed where element names are required; Palo server connection dropped after earlier rows succeeded.","solutions":["Inspect the wrapped cause in the stack trace to identify the failing row and value","Validate upstream data: no nulls in level fields and types match the configured fieldtype per level","Reduce batch size / check the Palo server connection stability","Test with a small sample of rows (Preview) to isolate the bad record"],"exampleFix":"// before\nString element = row[i]; // may be null\n// after\nif (row[i] == null) row[i] = \"\"; // or filter/repair nulls upstream","handlingStrategy":"validation","validationCode":"// validate row values before adding to buffer\nfor (int idx : data.indexes) {\n  if (idx >= 0 && rowData[idx] == null) throw new KettleException(\"Null element value at index \" + idx);\n}","typeGuard":"boolean isValidElement(Object v) { return v != null && !v.toString().isEmpty(); }","tryCatchPattern":"try { addToBatch(row); } catch (Exception e) {\n  logError(\"Row buffer add failed: \" + e.getCause(), e); setErrors(1);\n}","preventionTips":["Filter/repair nulls in level fields upstream","Ensure field types match the configured fieldtype per level","Preview with a small sample to catch bad rows early","Keep the Palo session/connection healthy for long runs"],"tags":["palo","batch","row-processing"],"backgroundTag":"database-write-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"}