PDA

View Full Version : Getting/Setting Vars not working on slave server.



PollieXmas
08-11-2009, 11:51 AM
Hi Guys,

I have a job that runs three transformations.

The first thing the job does is to set some vars.
The first transformation then goes an updates on of the vars
The second transformation then uses this var to write a record into a db table.

This works fine when executing them locally and even if I execute the job remotely but the transformations locally. However when I try and execute everything remotely, the second transformation does not pick up the change to the variable that the first transformation was supposed to set.

Any ideas?

Thanks
Paul

PollieXmas
08-15-2009, 02:43 AM
Am I correct in understanding that the intention of variables in PDI are to pass static information to Jobs and transformations before they start and are thus intended to be changed?

So the fact that by example actually worked is an anomaly and that I should rather investigate an alternative way to accomplish passing and changing information from one transform to another?

Thanks for the assistance.

Regards
Paul

fabianS
08-17-2009, 02:11 AM
Am I correct in understanding that the intention of variables in PDI are to pass static information to Jobs and transformations before they start and are thus intended to be changed?

If you add a 'not' before that 'to be changed' I'd agree. The variables provide settings to the whole transformation you're running. They do not transport information from one step to next.


So the fact that by example actually worked is an anomaly and that I should rather investigate an alternative way to accomplish passing and changing information from one transform to another?

What exactly are you trying to accomplish?
I've used variables to add static fields to my data. I've used variables to provide input to the transformations and I've used them to allow IT operators to change database connections and stuff like that.

If you're trying to transport multiple rows of data from one transformation to the next you should look into 'Get rows from result' and 'Copy rows to result'.

Does that help you?

PollieXmas
08-17-2009, 02:38 AM
Hi FabianS,

Yes, my mistake, it should read 'not intended to be changed'.

I simply wanted to pass the no of rows read/processed to the transformation that updates the dimension which stores the extract data.

As you suggested, simply replacing the set variables stage in the transformation with copy rows to results and then getting it in the subsequent transformation, did the trick.

The set variable solution was one of my first difficult things I implemented in Pentaho and when I got it to work, I did not touch it. It was before I got into the Pentho thinking. Now understanding how it is supposed to work I don't really know how I could get it to work in the first place!?

Anyway, thanks for pointing me in the right direction.

Regards
Paul

PollieXmas
08-17-2009, 04:38 AM
Hi FabianS,

I spoke too soon...

"copy rows to result" also only seem to work when executing locally. As soon as I ask it to execute remotely the transform that needs to "get rows from result" does not "see" any results.

Any ideas what I'm missing?

Thanks
Paul

PollieXmas
08-17-2009, 05:08 AM
I cannot see that I'm doing anything wrong, but until such time that I can get this resolved, I will have to settle for using files.