Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: setting a variable - one row per transformation

  1. #1

    Default setting a variable - one row per transformation

    Hi folks,
    I'm a bit stuck with a model, where I read from a table all records to be processed, write the rows with the step "copy rows to result", from there I'm running an other job: Within this job is a transformation which should read the result. In my understanding from the samples - one row only. But the context help and tip describe it as a "get rows from result". I wish to use one row only for dblookup, to write the data from this lookup to a variable (here one variable per run is allowed).
    From the descriptoin of Kettle's sample I got the impression, that is the way to go, but seems, I'm wrong:
    But I get all the time an error message, letting me know, the transformatoin is trying to write a 2nd row to the variable, which is not allowed as we know ...

    What would be the solution, the way to go?

    Tx. Alexander

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

    Default

    The problem is that all steps in a transformation run in a parallel. So what would be the value of a variable if more than 1 row would be allowed to hit the step (hint: it would depend on the moment the variable is used... at random you would get 1 of the possible values).

    Also for the same reason... even when 1 row hits the variable step, the variable only becomes active at that time. And some steps may already use the variable name before (which would then be undefined).

    So for variables you set the variable in 1 transformation and use them in another. Under the samples directory there's an example as "process all rows" which uses variable to do similar processing.

    Regards,
    Sven

  3. #3

    Default

    Hi Sven,
    Thanks for your reply, but your approach was just the one I was using. I tried to point out in my poste, I used your sample - I used a job within a job and this job consists of separate transformations. So the root job looks the rows up, writes them to results, the job after this starts a transformation, where the row is set to the variable.
    My understanding was, for every row in the parent job, the child is started in a loop. So the child gets only one row after the other.
    Just like in your sample.

    Do you think a screenshot would be helpful?

    Cheers, Alexander

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

    Default

    Then you're doing something wrong... if you start up the actual combination "1 time per row" you should not be getting multiple rows at the set variable step.

    My guess (from past experience) would be that you need 1 extra level/layer of jobs.

    Regards,
    Sven

  5. #5

    Default

    hm, thanks, I agree with you, but I don't see the solution ;-( cheers alexander

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.