{"record":{"id":"aba64b16e1b2610e","repo":"pentaho/pentaho-kettle","slug":"failed-to-add-dimension-rows","errorCode":null,"errorMessage":"Failed to add dimension rows","messagePattern":"Failed to add dimension 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":175,"sourceCode":"        }\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\" );\n\n        this.logBasic( \"Updating consolidations for Dimension\" + meta.getDimension() );\n        data.helper.addDimensionConsolidations( meta.getDimension(), this.consolidations );\n        this.logBasic( \"Consolidations updated.\" );\n\n        setOutputDone();\n        return false;\n      } catch ( Exception e ) {\n        throw new KettleException( \"Failed to add dimension rows\", e );\n      }\n    }\n\n    return true;\n  }\n\n  private void commitBatch() throws Exception {\n    data.helper.addDimensionElements( data.elementNamesBatch, meta.getElementType() );\n    while ( rowCount > 0 ) {\n      incrementLinesOutput();\n      rowCount--;\n    }\n    data.elementNamesBatch.clear();\n  }\n\n  public final boolean init( StepMetaInterface smi, StepDataInterface sdi ) {\n    meta = (PaloDimOutputMeta) smi;\n    data = (PaloDimOutputData) sdi;","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/palo/core/src/main/java/org/pentaho/di/trans/steps/palo/dimoutput/PaloDimOutput.java#L157-L193","documentation":"When the input stream ends, the step flushes its buffers: it adds buffered dimension rows and consolidations to the Palo dimension via data.helper.addDimensionRows/addDimensionConsolidations. Any exception in that final flush is wrapped as 'Failed to add dimension rows', meaning the writes to the Palo server failed at commit time.","triggerScenarios":"Final flush to Palo fails: connection lost during the run, element values invalid for the dimension, dimension structure changed concurrently, or server-side quota/error during bulk add.","commonSituations":"Long-running transformation whose Palo session expired; bulk insert too large for the server; duplicate/conflicting element definitions submitted at once.","solutions":["Check the wrapped cause for the specific Palo server error","Verify network/session stability and re-run; consider smaller batch commits (the 100-row commit size)","Ensure the dimension on the server was not restructured while the transformation ran","Validate all buffered element values (types, uniqueness) before the run"],"exampleFix":"// before\ncommitBatch(); // every 100 rows, one giant final flush may fail\n// after\nif (data.elementNamesBatch.size() % 50 == 0) commitBatch(); // smaller batches","handlingStrategy":"retry","validationCode":"// validate buffered elements before final flush\nif (data.elementNamesBatch.isEmpty()) { logBasic(\"Nothing to flush\"); return; }","typeGuard":null,"tryCatchPattern":"try { flushDimensionRows(); } catch (Exception e) {\n  logError(\"Final dimension flush failed: \" + e.getCause(), e); setErrors(1);\n  // optionally retry once\n}","preventionTips":["Keep sessions alive on long runs; use smaller batch commits","Do not restructure the Palo dimension while a transformation writes to it","Check server capacity/quota for bulk element inserts","Retry failed transformations after transient connection loss"],"tags":["palo","dimension","bulk-write"],"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"}