Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: When is a type not a type? The type of field is different of the replace value field

  1. #1
    Join Date
    Aug 2011
    Posts
    8

    Default When is a type not a type? The type of field is different of the replace value field

    I have a Stream Lookup that takes from a Table Input.
    A field is specified to be retrieved and the Type is set to Date.
    A Modified Java Script Value step assigns todays date to a variable.
    Another field retrieved is compared in a Filter Rows step.
    If true, a Set Field Value step assigns the variable holding the days date to the field retrieved int he Stream Lookup (which is set to Date).

    Except it doesn't work:

    Code:
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) : Unexpected error
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) : org.pentaho.di.core.exception.KettleStepException: 
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) : The type of the field [SegmentDateChanged (String)] is different of the replace value field [today (Date)]
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) : 
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) :  at org.pentaho.di.trans.steps.setvaluefield.SetValueField.processRow(SetValueField.java:107)
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) :  at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    2011/10/18 13:37:23 - Set SegmentDateChanged to today's date.0 - ERROR (version 4.2.0-RC1, build 15366 from 2011-06-14 12.04.35 by buildguy) :  at java.lang.Thread.run(Unknown Source)
    Is this a bug?

  2. #2
    Join Date
    Jul 2009
    Posts
    476

    Default

    The SegmentDateChanged field is a String. You might go back to the step that creates that field and see why it's defined as a String, and not a Date.

    When troubleshooting transformations, you can right-click on a step, and then click "Show input fields." You will see a list of the fields that are passed to the step, along with their data types and the steps that originated them. You can also right-click a step and click "Show output fields," which will show how the fields look after the step runs. These two features can help track down issues with data types, field names, etc.

  3. #3
    Join Date
    Aug 2011
    Posts
    8

    Default

    Thanks for the reply Rob.

    Looking at the Table Input that generates the Field I could see it was coming out as a String. The column in the Table was defined as Date (a more recent SqlServer datatype) and I don't think Spoon can handle it so treated it as a string. Changing it to datetime means the Table Input now generates a Date type.
    Last edited by crapo; 10-18-2011 at 11:13 AM.

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.