{"record":{"id":"b8e23d2bd7550df6","repo":"pentaho/pentaho-kettle","slug":"i-don-t-know-how-to-convert-a-boolean-to-a-internet-address","errorCode":null,"errorMessage":" : I don't know how to convert a boolean to a Internet address.","messagePattern":" : I don't know how to convert a boolean to a Internet address\\.","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java","lineNumber":133,"sourceCode":"            return convertIntegerToInternetAddress( (Long) convertBinaryStringToNativeType( (byte[]) object ) );\n          case STORAGE_TYPE_INDEXED:\n            return convertIntegerToInternetAddress( (Long) index[( (Integer) object ).intValue()] );\n          default:\n            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_BIGNUMBER:\n        switch ( storageType ) {\n          case STORAGE_TYPE_NORMAL:\n            return convertBigNumberToInternetAddress( (BigDecimal) object );\n          case STORAGE_TYPE_BINARY_STRING:\n            return convertBigNumberToInternetAddress( (BigDecimal) convertBinaryStringToNativeType( (byte[]) object ) );\n          case STORAGE_TYPE_INDEXED:\n            return convertBigNumberToInternetAddress( (BigDecimal) index[( (Integer) object ).intValue()] );\n          default:\n            throw new KettleValueException( toString() + \" : Unknown storage type \" + storageType + \" specified.\" );\n        }\n      case TYPE_BOOLEAN:\n        throw new KettleValueException( toString()\n          + \" : I don't know how to convert a boolean to a Internet address.\" );\n      case TYPE_BINARY:\n        throw new KettleValueException( toString()\n          + \" : I don't know how to convert a binary value to Internet address.\" );\n      case TYPE_SERIALIZABLE:\n        throw new KettleValueException( toString()\n          + \" : I don't know how to convert a serializable value to Internet address.\" );\n\n      default:\n        throw new KettleValueException( toString() + \" : Unknown type \" + type + \" specified.\" );\n    }\n  }\n\n  @Override\n  public Date getDate( Object object ) throws KettleValueException {\n    throw new KettleValueException( toStringMeta()\n      + \": it's not possible to convert from Internet Address to a date\" );\n  }","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java#L115-L151","documentation":"getInternetAddress() simply has no conversion defined from a boolean value to a java.net.InetAddress. When the value meta's type is TYPE_BOOLEAN, the switch throws this exception immediately, regardless of storage type. Internet Address values must originate from string, number, integer, big number, or InetAddress data.","triggerScenarios":"Calling getInternetAddress(), getString(), inetAddress(), or getNativeDataType() on a ValueMetaInternetAddress whose type is TYPE_BOOLEAN; typically after mislabeling a field's type in row metadata or feeding a Boolean into the conversion path.","commonSituations":"A transform mapping columns by position and assigning a boolean column the Internet Address type; user-built metadata where type was set to TYPE_BOOLEAN by mistake; reading a stream where a field type changed upstream but metadata downstream was not updated.","solutions":["Fix the value meta type: it must be TYPE_INET/TYPE_STRING/TYPE_NUMBER/TYPE_INTEGER/TYPE_BIGNUMBER, not TYPE_BOOLEAN","Remove or reroute the boolean field before the Internet Address conversion step","Add a metadata check (valueMeta.getType()) before calling the conversion","If a boolean genuinely encodes an address flag, map it to a real address string first"],"exampleFix":"// before\nInetAddress addr = meta.getInternetAddress(boolObject); // type==TYPE_BOOLEAN -> throws\n// after\nif (meta.getType() == ValueMetaInterface.TYPE_BOOLEAN) {\n  throw new KettleException(\"Field \" + meta.getName() + \" is boolean; cannot be an Internet address\");\n}\nInetAddress addr = meta.getInternetAddress(meta.convertData(meta, boolObject));","handlingStrategy":"validation","validationCode":"if (meta.getType() == ValueMetaInterface.TYPE_BOOLEAN) {\n  throw new KettleException(\"Field \" + meta.getName() + \" is boolean and cannot be converted to an Internet address\");\n}","typeGuard":"boolean convertible = meta.getType() == ValueMetaInterface.TYPE_INET\n    || meta.getType() == ValueMetaInterface.TYPE_STRING\n    || meta.getType() == ValueMetaInterface.TYPE_NUMBER\n    || meta.getType() == ValueMetaInterface.TYPE_INTEGER\n    || meta.getType() == ValueMetaInterface.TYPE_BIGNUMBER;","tryCatchPattern":"try {\n  InetAddress addr = meta.getInternetAddress(object);\n} catch (KettleValueException e) {\n  if (e.getMessage().contains(\"convert a boolean\")) { /* fix upstream field type */ }\n  throw e;\n}","preventionTips":["Verify stream field types with getFields() before transforms that convert data","Map fields by name, not by position, to avoid type mismatches","Keep value meta types consistent between upstream and downstream steps","Review row metadata changes after stream merges"],"tags":["kettle","pdi","type-conversion","internet-address"],"backgroundTag":"incompatible-source-type","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"}