{"record":{"id":"bf29b7ba1d97b1a5","repo":"pentaho/pentaho-kettle","slug":"pgbulkloader-doesn-t-handle-the-type","errorCode":null,"errorMessage":"PGBulkLoader doesn't handle the type ","messagePattern":"PGBulkLoader doesn't handle the type ","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoader.java","lineNumber":414,"sourceCode":"            case ValueMetaInterface.TYPE_NUMBER:\n              if ( valueMeta.isStorageBinaryString() ) {\n                pgCopyOut.write( (byte[]) valueData );\n              } else {\n                pgCopyOut.write( Double.toString( valueMeta.getNumber( valueData ) ).getBytes( clientEncoding ) );\n              }\n              break;\n            case ValueMetaInterface.TYPE_BIGNUMBER:\n              if ( valueMeta.isStorageBinaryString() ) {\n                pgCopyOut.write( (byte[]) valueData );\n              } else {\n                BigDecimal big = valueMeta.getBigNumber( valueData );\n                if ( big != null ) {\n                  pgCopyOut.write( big.toString().getBytes( clientEncoding ) );\n                }\n              }\n              break;\n            default:\n              throw new KettleException( \"PGBulkLoader doesn't handle the type \" + valueMeta.getTypeDesc() );\n          }\n        }\n      }\n\n      // Now write a newline\n      //\n      pgCopyOut.write( data.newline );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error serializing rows of data to the COPY command\", e );\n    }\n\n  }\n\n  protected void verifyDatabaseConnection() throws KettleException {\n    // Confirming Database Connection is defined.\n    if ( meta.getDatabaseMeta() == null ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"PGBulkLoaderMeta.GetSQL.NoConnectionDefined\" ) );\n    }","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/postgresql-db-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/pgbulkloader/PGBulkLoader.java#L396-L432","documentation":"writeRowToPostgres only handles a fixed set of ValueMetaInterface types (String, Number, Integer, BigNumber, Date, Timestamp, Boolean, Binary). Any other value type falls into the outer default branch and throws with the type description. The loader does not support that data type in COPY output.","triggerScenarios":"A stream field whose ValueMetaInterface type is not one of the implemented types (e.g. TYPE_INET, TYPE_JSON, TYPE_ENUM depending on version) reaches writeRowToPostgres via processRow.","commonSituations":"Upstream steps emitting newer Kettle types the bulk loader was never updated for; JSON/UUID-ish data typed as specialized ValueMeta instead of String; custom value meta plugins feeding the loader.","solutions":["Add a 'Select values' step before the loader to convert the unsupported field to String (or another supported type)","Check the field types arriving at the loader (right-click > Show fields) and fix the producing step to emit standard types","Upgrade the plugin/Pentaho version that adds support for the type, if available","Convert specialized types (e.g. JSON, INET) to String in the source step or a Calculator/UDJE step"],"exampleFix":"// before\n// stream field type: JSON -> default branch -> KettleException\n// after (Select values / upstream conversion)\nvalueMeta.convertData( originalMeta, originalData ); // or map JSON field to TYPE_STRING","handlingStrategy":"validation","validationCode":"// pre-flight: reject unsupported value types before the loader runs\nfor ( ValueMetaInterface vm : inputRowMeta.getValueMetaList() ) {\n  int t = vm.getType();\n  boolean ok = t == ValueMetaInterface.TYPE_STRING || t == ValueMetaInterface.TYPE_NUMBER\n    || t == ValueMetaInterface.TYPE_INTEGER || t == ValueMetaInterface.TYPE_BIGNUMBER\n    || t == ValueMetaInterface.TYPE_DATE || t == ValueMetaInterface.TYPE_TIMESTAMP\n    || t == ValueMetaInterface.TYPE_BOOLEAN || t == ValueMetaInterface.TYPE_BINARY;\n  if ( !ok ) throw new IllegalStateException( \"Unsupported type \" + vm.getTypeDesc() + \" for \" + vm.getName() );\n}","typeGuard":null,"tryCatchPattern":"try {\n  step.processRow();\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"doesn't handle the type\" ) ) {\n    // insert a Select values step to convert the offending field\n  }\n}","preventionTips":["Convert exotic types (JSON, INET, etc.) to String before bulk loading","Inspect incoming row types in Spoon before configuring the loader","Keep upstream steps emitting standard Kettle types"],"tags":["kettle","postgresql","type-mismatch","unsupported"],"backgroundTag":"unsupported-operation","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"}