org.pentaho.di.core.exception.KettleStepException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The calculator step can convert Timestamp fields to Date (see calculator1.ktr), and Date fields can be converted to Timestamp type. From a user's perspective this raises the expectation that we can in principle use Timestamp fields wherever it is appropriate for Date fields to appear. From a developer's perspective it also holds true since the ValueMeta interface for timestamps is a subclass of that of the one for Dates, and the internal data types are java.util.Date and java.sql.Timestamp, which are also proper subclasses of each other. However, this does not work as expected. When we create a new field (Calculator2.ktr) of the Date type having a "Date a + b days" calulation to add an integer (b) to a timestamp field (a) the error is: 2013/11/15 14:54:18 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : !Calculator.ErrorInStepRunning : 2013/11/15 14:54:18 - Calculator.0 - resultType: 9; targetMeta: 3 2013/11/15 14:54:18 - Calculator.0 - java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - ! 2013/11/15 14:54:18 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : Unexpected error 2013/11/15 14:54:18 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : org.pentaho.di.core.exception.KettleStepException: 2013/11/15 14:54:18 - Calculator.0 - Error while running the step 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - resultType: 9; targetMeta: 3 2013/11/15 14:54:18 - Calculator.0 - java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:198) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:60) 2013/11/15 14:54:18 - Calculator.0 - at java.lang.Thread.run(Thread.java:722) 2013/11/15 14:54:18 - Calculator.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2013/11/15 14:54:18 - Calculator.0 - resultType: 9; targetMeta: 3 2013/11/15 14:54:18 - Calculator.0 - java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:793) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:179) 2013/11/15 14:54:18 - Calculator.0 - ... 2 more 2013/11/15 14:54:18 - Calculator.0 - Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaTimestamp.getTimestamp(ValueMetaTimestamp.java:124) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaTimestamp.getDate(ValueMetaTimestamp.java:66) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3495) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:791) 2013/11/15 14:54:18 - Calculator.0 - ... 3 more When we use the same calculation but set the result type to Timestamp, a different error occurs: 2013/11/15 14:56:54 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : !Calculator.ErrorInStepRunning : 2013/11/15 14:56:54 - Calculator.0 - resultType: 9; targetMeta: 9 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - ! 2013/11/15 14:56:54 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : Unexpected error 2013/11/15 14:56:54 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : org.pentaho.di.core.exception.KettleStepException: 2013/11/15 14:56:54 - Calculator.0 - Error while running the step 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - resultType: 9; targetMeta: 9 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:198) 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:60) 2013/11/15 14:56:54 - Calculator.0 - at java.lang.Thread.run(Thread.java:722) 2013/11/15 14:56:54 - Calculator.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2013/11/15 14:56:54 - Calculator.0 - resultType: 9; targetMeta: 9 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:793) 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:179) 2013/11/15 14:56:54 - Calculator.0 - ... 2 more 2013/11/15 14:56:54 - Calculator.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaTimestamp.convertData(ValueMetaTimestamp.java:401) 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:791) 2013/11/15 14:56:54 - Calculator.0 - ... 3 more
    via by Roland Bouman,
  • The calculator step can convert Timestamp fields to Date (see calculator1.ktr), and Date fields can be converted to Timestamp type. From a user's perspective this raises the expectation that we can in principle use Timestamp fields wherever it is appropriate for Date fields to appear. From a developer's perspective it also holds true since the ValueMeta interface for timestamps is a subclass of that of the one for Dates, and the internal data types are java.util.Date and java.sql.Timestamp, which are also proper subclasses of each other. However, this does not work as expected. When we create a new field (Calculator2.ktr) of the Date type having a "Date a + b days" calulation to add an integer (b) to a timestamp field (a) the error is: 2013/11/15 14:54:18 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : !Calculator.ErrorInStepRunning : 2013/11/15 14:54:18 - Calculator.0 - resultType: 9; targetMeta: 3 2013/11/15 14:54:18 - Calculator.0 - java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - ! 2013/11/15 14:54:18 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : Unexpected error 2013/11/15 14:54:18 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : org.pentaho.di.core.exception.KettleStepException: 2013/11/15 14:54:18 - Calculator.0 - Error while running the step 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - resultType: 9; targetMeta: 3 2013/11/15 14:54:18 - Calculator.0 - java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:198) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:60) 2013/11/15 14:54:18 - Calculator.0 - at java.lang.Thread.run(Thread.java:722) 2013/11/15 14:54:18 - Calculator.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2013/11/15 14:54:18 - Calculator.0 - resultType: 9; targetMeta: 3 2013/11/15 14:54:18 - Calculator.0 - java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:793) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:179) 2013/11/15 14:54:18 - Calculator.0 - ... 2 more 2013/11/15 14:54:18 - Calculator.0 - Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaTimestamp.getTimestamp(ValueMetaTimestamp.java:124) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaTimestamp.getDate(ValueMetaTimestamp.java:66) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3495) 2013/11/15 14:54:18 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:791) 2013/11/15 14:54:18 - Calculator.0 - ... 3 more When we use the same calculation but set the result type to Timestamp, a different error occurs: 2013/11/15 14:56:54 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : !Calculator.ErrorInStepRunning : 2013/11/15 14:56:54 - Calculator.0 - resultType: 9; targetMeta: 9 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - ! 2013/11/15 14:56:54 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : Unexpected error 2013/11/15 14:56:54 - Calculator.0 - ERROR (version TRUNK-SNAPSHOT, build 1 from 2013-11-13 09.29.02 by rbouman) : org.pentaho.di.core.exception.KettleStepException: 2013/11/15 14:56:54 - Calculator.0 - Error while running the step 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - resultType: 9; targetMeta: 9 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:198) 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:60) 2013/11/15 14:56:54 - Calculator.0 - at java.lang.Thread.run(Thread.java:722) 2013/11/15 14:56:54 - Calculator.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2013/11/15 14:56:54 - Calculator.0 - resultType: 9; targetMeta: 9 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:793) 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:179) 2013/11/15 14:56:54 - Calculator.0 - ... 2 more 2013/11/15 14:56:54 - Calculator.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2013/11/15 14:56:54 - Calculator.0 - Timestamp : can't be converted to a timestamp 2013/11/15 14:56:54 - Calculator.0 - 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.core.row.value.ValueMetaTimestamp.convertData(ValueMetaTimestamp.java:401) 2013/11/15 14:56:54 - Calculator.0 - at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:791) 2013/11/15 14:56:54 - Calculator.0 - ... 3 more
    via by Roland Bouman,
    • org.pentaho.di.core.exception.KettleStepException: Error while running the step resultType: 9; targetMeta: 3 java.util.Date cannot be cast to java.sql.Timestamp at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:198) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:60) at java.lang.Thread.run(Thread.java:722) Caused by: org.pentaho.di.core.exception.KettleValueException: resultType: 9; targetMeta: 3 java.util.Date cannot be cast to java.sql.Timestamp at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:793) at org.pentaho.di.trans.steps.calculator.Calculator.processRow(Calculator.java:179) ... 2 more Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp at org.pentaho.di.core.row.value.ValueMetaTimestamp.getTimestamp(ValueMetaTimestamp.java:124) at org.pentaho.di.core.row.value.ValueMetaTimestamp.getDate(ValueMetaTimestamp.java:66) at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3495) at org.pentaho.di.trans.steps.calculator.Calculator.calcFields(Calculator.java:791) ... 3 more
    No Bugmate found.