Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Conversion Masks - Switch Step

  1. #1

    Default Conversion Masks - Switch Step

    Hey guys,

    Having a small hiccup with the switch step and not sure what I am doing wrong:

    I am trying to read from a dimension table (created with the dimension update component) and trying to select the most recent record for an entry. I am using the switch statement and switching on the date_to field. I set the 'Case value data type' to "Date" and the 'Case value conversion mask' to "MM/dd/yyyy HH:mm:ss a" and send records with the value "12/31/2199 11:59:59 PM" to a step. On execution I get the following error:

    Code:
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Unable to convert value [12/31/2199 11:59:59 PM]
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : org.pentaho.di.core.exception.KettleValueException: 
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : DATE_TO String : couldn't convert string [12/31/2199 11:59:59 PM] to a date using format ["MM/dd/yyyy HH:mm:ss a"]
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Unparseable date: "12/31/2199 11:59:59 PM"
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertStringToDate(ValueMeta.java:603)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.getDate(ValueMeta.java:1646)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertData(ValueMeta.java:3041)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertDataFromString(ValueMeta.java:3236)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.trans.steps.switchcase.SwitchCase.init(SwitchCase.java:140)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:48)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at java.lang.Thread.run(Unknown Source)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Caused by: java.text.ParseException: Unparseable date: "12/31/2199 11:59:59 PM"
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at java.text.DateFormat.parse(Unknown Source)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertStringToDate(ValueMeta.java:598)
    2009/04/15 15:07:26 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	... 6 more
    2009/04/15 15:07:26 - Switch On Record Date - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Error initializing step [Switch On Record Date]
    Any suggestions?

    Thanks.

    Keith

  2. #2

    Default

    In the stack flow below, there are quotes on the date conversion mask but I get the same error with or without the quotes:

    Code:
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Unable to convert value [12/31/2199 11:59:59 PM]
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : org.pentaho.di.core.exception.KettleValueException: 
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : DATE_TO String : couldn't convert string [12/31/2199 11:59:59 PM] to a date using format [MM/dd/yyyy HH:mm:ss a]
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Unparseable date: "12/31/2199 11:59:59 PM"
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertStringToDate(ValueMeta.java:603)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.getDate(ValueMeta.java:1646)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertData(ValueMeta.java:3041)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertDataFromString(ValueMeta.java:3236)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.trans.steps.switchcase.SwitchCase.init(SwitchCase.java:140)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:48)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at java.lang.Thread.run(Unknown Source)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : Caused by: java.text.ParseException: Unparseable date: "12/31/2199 11:59:59 PM"
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at java.text.DateFormat.parse(Unknown Source)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	at org.pentaho.di.core.row.ValueMeta.convertStringToDate(ValueMeta.java:598)
    2009/04/15 15:20:33 - Switch On Record Date.0 - ERROR (version 3.2.0-RC1, build 10487 from 2009-04-01 05.47.20 by tomcat) : 	... 6 more

  3. #3
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Code:
    MM/dd/yyyy hh:mm:ss a
    The hours can't be in 24h format if you use an AM/PM specification.

  4. #4

    Default

    /bonk_self

    Thanks.

    Keith

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.