Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Problem in Set Variable step

  1. #1
    Join Date
    Sep 2008
    Posts
    28

    Default Problem in Set Variable step

    Hi

    I have tried to make an example that is based on the Process all tables job in the samples folder.

    My example [transformation snapshot attached] has a Job, which has the steps:

    1) Get List of tables (transformation that uses an table input and does - Show tables in it, selects the value of tablename field and has a copy rows to result step ). This step works fine.
    2) Job - which has the set variable transformation
    it has a get rows from previous result step and a Set variable step to set the name of the table.
    the next step in this transformation has a table input and a table output. The table input reads the table variable name that has been set and then outputs its contents to the output table.

    In the inner job, the set variable step fails and gives the following error:

    Set Variables.0 - Setting environment variables...
    2008/10/31 08:42:27 - Set Variables.0 - Set variable TABLENAME to value [encounter]
    2008/10/31 08:42:27 - Set Variables.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : Unexpected error :
    2008/10/31 08:42:27 - Set Variables.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : org.pentaho.di.core.exception.KettleStepException:
    2008/10/31 08:42:27 - Set Variables.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : Only 1 input row was expected to set the variables and at least 2 were received.
    2008/10/31 08:42:27 - Set Variables.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) :
    2008/10/31 08:42:27 - Set Variables.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : at org.pentaho.di.trans.steps.setvariable.SetVariable.processRow(SetVariable.java:212)
    2008/10/31 08:42:27 - Set Variables.0 - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : at org.pentaho.di.trans.steps.setvariable.SetVariable.run(SetVariable.java:243)
    2008/10/31 08:42:27 - Set Variables.0 - Finished processing (I=0, O=0, R=2, W=1, U=0, E=1)
    2008/10/31 08:42:28 - set_tablename - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : Errors detected!
    2008/10/31 08:42:28 - set_tablename - ERROR (version 3.0.4, build 53 from 2008/06/24 11:14:00) : Errors detected!
    2008/10/31 08:42:28 - set_tablename - Transformation detected 1 steps with errors!
    2008/10/31 08:42:28 - set_tablename - Transformation is killing the other steps!
    2008/10/31 08:42:28 - set_tablename - Looking at step: Get rows from result
    2008/10/31 08:42:28 - set_tablename - Looking at step: Set Variables
    2008/10/31 08:42:28 - Job 1_in_table_update - Finished jobentry [set_tablename] (result=[false])

    This method to set the table name is taken from the Process all jobs example in the samples/jobs folder.

    Please help with this error. How do I make the set variable step to work??

    -AK
    Attached Images Attached Images    

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Your structure is wrong... set variables step allows only 1 row on its put... more than one wouldn't make sense.

    You have to make the last part of your job a layer deeper... so you execute the set variable transformation and the execution of the real transformation in 1 separate job... so that with each incoming row the whole thing is executed.

    Regards,
    Sven

  3. #3
    Join Date
    Sep 2008
    Posts
    28

    Default

    Hi

    Thanks for your response. I shall further extend my example to a layer deeper and try out your suggestion.

    As of now the error from the set variable step got resolved by enabling the
    'execute for every input row' step on the
    table_list transformation.

    Thanks again,
    AK

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    But as you do it now you will probably only get the latest value for the variable set

    Regards,
    Sven

  5. #5
    Join Date
    Sep 2008
    Posts
    28

    Default

    OH!

    Yeah I see what you are saying.. I will work more on extending it to a layer deeper ..which I anyways have to do to get some more complex transformations, and see how that works.

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.