pentaho/pentaho-kettle · error · KettleException

Error loading data:

Error message

Error loading data: 

What it means

In writeBufferToMonetDB(), after the buffer is flushed to the MAPI mserver child process, data.in.waitForPrompt() returns a non-null error string when the MonetDB COPY INTO loader reports a problem. The step converts that string into a KettleException prefixed 'Error loading data: '.

Solutions

  1. Inspect the error string after the prefix - it names the offending row/column from MonetDB
  2. Verify the row's field count and formats match the target table definition
  3. Escape or remove occurrences of the field/record separator characters in the data
  4. Re-run autoAdjustSchema/DDL so the table matches the current row layout
Defensive patterns

Strategy: validation

Validate before calling

// validate row shape against table before writing to buffer
if ( row.length != expectedColumnCount ) throw new KettleException( "Field count mismatch" );
for each value: check it contains no unescaped field/record separator characters

Type guard

null

Try / catch

try { loader.putRow( row ); } catch ( KettleException e ) { log.error( "MonetDB load error: " + e.getMessage() ); quarantine the offending row and continue or abort }

Prevention

When it happens

Trigger: The first waitForPrompt() after writing buffered rows to the mserver stdin returns an error message, e.g. a rejected row (wrong number of fields, bad value format for a column, NOT NULL violation) during the COPY INTO load.

Common situations: Incoming row fields don't match the table's column count/types; special characters or unescaped field/record separators in the data; NULL handling mismatches; a schema change after the table was created leaves rows incompatible.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/9b49cbdddbcdf8f7. Report an issue: GitHub.

Appendix: source

Thrown at plugins/monet-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/monetdbbulkloader/MonetDBBulkLoader.java:491

        logDetailed( cmd );
      }

      data.out.write( 's' );
      data.out.write( cmdBuff.toString() );
      data.out.newLine();

      for ( int i = 0; i < data.bufferIndex; i++ ) {
        String buffer = data.rowBuffer[i];
        data.out.write( buffer );
        if ( log.isRowLevel() ) {
          logRowlevel( buffer );
        }
      }

      // wait for the prompt
      String error = data.in.waitForPrompt();
      if ( error != null ) {
        throw new KettleException( "Error loading data: " + error );
      }
      // write an empty line, forces the flush of the stream
      data.out.writeLine( "" );

      // again...
      error = data.in.waitForPrompt();
      if ( error != null ) {
        throw new KettleException( "Error loading data: " + error );
      }

      if ( !meta.isCompatibilityDbVersionMode() ) {
        // write an empty line, forces the flush of the stream
        data.out.writeLine( "" );

        // again...
        error = data.in.waitForPrompt();
        if ( error != null ) {
          throw new KettleException( "Error loading data: " + error );

View on GitHub (pinned to f3058517a1)