Search code examples
pentahokettle

Ignoring date parsing error in Kettle


On running a transformation with kettle I get following error:

2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 - ERROR (version 7.0.0.0-25, build 1 from 2016-11-05 15.35.36 by buildguy) : Because of an error, this step can't continue:
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 - ERROR (version 7.0.0.0-25, build 1 from 2016-11-05 15.35.36 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 - CREATION_DATE String : couldn't convert string [20170326 01:10] to a date using format [yyyyMMdd HH:mm] on offset location 14
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 - 20170326 01:10
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 - 
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToDate(ValueMetaBase.java:791)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.getDate(ValueMetaBase.java:2047)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3672)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertBinaryStringToNativeType(ValueMetaBase.java:1371)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.getString(ValueMetaBase.java:1555)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.RowMeta.getString(RowMeta.java:319)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.RowMeta.getString(RowMeta.java:827)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:372)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:125)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at java.lang.Thread.run(Thread.java:745)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 - Caused by: java.text.ParseException: 20170326 01:10
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToDate(ValueMetaBase.java:782)
2017/06/01 17:57:46 - Table PAX_TKT_UPDATES.0 -     ... 10 more

Questions:

  1. The date 20170326 01:10 looks absolutely valid for format yyyyMMdd. Why the parse error
  2. I've selected ignore insert errors in my table output step and that ignores insert errors (such as column constraint errors). But it doesn't seem to ignore data conversion errors and stops the transformation. How can I ignore data conversion errors?

Solution

  • I'm going to guess you're running that transformation in a computer located in Europe.

    March 26 is the last Sunday of March and at 1:00 timezone changed to Daylight savings time. Therefore, in local time, there is no such time. After 00:59:59 comes 02:00:00.

    Your field on the database is probably a Datetime, which is in local time and therefore the timezone changed at 1am. You can use one of the following approaches:

    • change the data type to to UTC or fixed timezone;
    • convert your data making the timezone explicit, e.g., using the format 'yyyyMMdd HH:mm +0100'