java.lang.Double

Pentaho BI Platform Tracking | Andrei Puhach | 3 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    "If field value is null" ("Replace null value") step works differently in PDI 5.0.1 compared with PDI 4.4.0: if a transformation is created/saved in PDI 4 and is opened in PDI 5 the new "Set empty string?" option is populated as "Y" what causes producing empty strings where NULLs were required. It may cause ValueMetaBase exceptions from further steps expecting the Number type when a String value may be cast to Double. Unexpected conversion error while converting value [myField Number] to a Number java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1598) ... at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1527) ... 10 more The problem is located in the IfNullMeta class: https://github.com/pentaho/pentaho-kettle/blob/c03038462b892307eea99f92e5baa17da9e2ad7a/engine/src/org/pentaho/di/trans/steps/ifnull/IfNullMeta.java#L320: for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); ... String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = Const.isEmpty( typeemptyString ) || "Y".equalsIgnoreCase( typeemptyString ); } should be for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = !Const.isEmpty( typeemptyString ) && "Y".equalsIgnoreCase( typeemptyString ); }

    Pentaho BI Platform Tracking | 3 years ago | Andrei Puhach
    java.lang.Double
  2. 0

    "If field value is null" ("Replace null value") step works differently in PDI 5.0.1 compared with PDI 4.4.0: if a transformation is created/saved in PDI 4 and is opened in PDI 5 the new "Set empty string?" option is populated as "Y" what causes producing empty strings where NULLs were required. It may cause ValueMetaBase exceptions from further steps expecting the Number type when a String value may be cast to Double. Unexpected conversion error while converting value [myField Number] to a Number java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1598) ... at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double at org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1527) ... 10 more The problem is located in the IfNullMeta class: https://github.com/pentaho/pentaho-kettle/blob/c03038462b892307eea99f92e5baa17da9e2ad7a/engine/src/org/pentaho/di/trans/steps/ifnull/IfNullMeta.java#L320: for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); ... String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = Const.isEmpty( typeemptyString ) || "Y".equalsIgnoreCase( typeemptyString ); } should be for ( int i = 0; i < nrtypes; i++ ) { Node tnode = XMLHandler.getSubNodeByNr( types, "valuetype", i ); String typeemptyString = XMLHandler.getTagValue( tnode, "set_type_empty_string" ); setTypeEmptyString[i] = !Const.isEmpty( typeemptyString ) && "Y".equalsIgnoreCase( typeemptyString ); }

    Pentaho BI Platform Tracking | 3 years ago | Andrei Puhach
    java.lang.Double

    Root Cause Analysis

    1. java.lang.Double

      No message provided

      at org.pentaho.di.core.row.value.ValueMetaBase.getNumber()
    2. org.pentaho.di
      ValueMetaBase.getNumber
      1. org.pentaho.di.core.row.value.ValueMetaBase.getNumber(ValueMetaBase.java:1598)
      1 frame