{"record":{"id":"bdfb63ac934bf7a2","repo":"pentaho/pentaho-kettle","slug":"it-s-not-possible-to-convert-from-internet-address-to-a-date","errorCode":null,"errorMessage":": it's not possible to convert from Internet Address to a date","messagePattern":": it's not possible to convert from Internet Address to a date","errorType":"exception","errorClass":"KettleValueException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java","lineNumber":149,"sourceCode":"        }\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  }\n\n  @Override\n  public Long getInteger( Object object ) throws KettleValueException {\n    InetAddress address = getInternetAddress( object );\n    if ( address == null ) {\n      return null;\n    }\n    long total = 0L;\n    byte[] addr = address.getAddress();\n\n    if ( addr.length > 8 ) {\n      throw new KettleValueException( \"Unable to convert Internet Address v6 to an Integer: \"\n        + getString( object ) + \" (The precision is too high to be contained in a long integer value)\" );\n    }\n\n    for ( int i = 0; i < addr.length; i++ ) {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/row/value/ValueMetaInternetAddress.java#L131-L167","documentation":"ValueMetaInternetAddress.getDate() is intentionally unimplemented: an Internet Address cannot be meaningfully represented as a Kettle Date, so the method unconditionally throws this KettleValueException. Any attempt to read an Internet Address field as a date hits this hard stop.","triggerScenarios":"Calling getDate(object) on a ValueMetaInternetAddress directly, or any pipeline step that requests date output for a field whose metadata is Internet Address (e.g. a 'Select values' / calculator step converting to Date).","commonSituations":"Misconfigured transform that maps an IP/host field into a Date-typed target; generic row-reading code iterating fields and calling getDate() on every value without checking the field type; copy/paste of field mappings after a type change.","solutions":["Do not read Internet Address fields as dates; use getInternetAddress()/getString()/getStringMeta() instead","Fix the target field metadata so the field is not typed as Date downstream","Check valueMeta.getType()/getTypeDesc() before choosing which getter to call","If you need a timestamp alongside the address, add a separate Date field to the row"],"exampleFix":"// before\nDate d = internetAddressMeta.getDate(row[i]); // always throws\n// after\nif (internetAddressMeta instanceof ValueMetaInternetAddress) {\n  String s = internetAddressMeta.getString(row[i]); // or getInternetAddress(...)\n} else {\n  Date d = internetAddressMeta.getDate(row[i]);\n}","handlingStrategy":"type-guard","validationCode":"if (meta instanceof ValueMetaInternetAddress) {\n  throw new KettleException(\"Field \" + meta.getName() + \" is an Internet address; use getInternetAddress()/getString(), not getDate()\");\n}","typeGuard":"boolean isDateReadable = !(meta instanceof ValueMetaInternetAddress)\n    && meta.getType() != ValueMetaInterface.TYPE_INET;","tryCatchPattern":"try {\n  Date d = meta.getDate(object);\n} catch (KettleValueException e) {\n  if (e.getMessage().contains(\"Internet Address to a date\")) { /* use getString/getInternetAddress instead */ }\n  throw e;\n}","preventionTips":["Dispatch getters by valueMeta.getType(), not by assuming Date","Never map address fields into Date-typed targets in transforms","Use generic conversion via convertData() from a compatible source meta","Document field types in transform mappings to avoid copy/paste type drift"],"tags":["kettle","pdi","unsupported-operation","date"],"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"}