Andrey
Andrey

Reputation: 1759

Pentaho transformation swithc/sace doesnt work as suposed to be

Pentaho , i have transformatipn step enter image description here

set_useful_life have select from the table and assign the result to the variable. them switch/case, check result, and supposed to run SQL dwh_adhoc_useful_life step only if the variable is 2 enter image description here

I 100% sure that variable is 1 but it still execute SQL dwh_adhoc_useful_life step. and at this moment I don't understand how to work around it? Why am I doing this check here and not in the job, because this transformation receives variables from the previous step, and if I am doing enter image description here in the job and execute transformation step, I am losing all variables and this step doesn't execute for each available passed from the previous transformation step enter image description here

Upvotes: 0

Views: 55

Answers (1)

Ana GH
Ana GH

Reputation: 1700

I think your problem is a concept of how PDI works.

In a transformation every step is initialized at the beginning, waiting to process the rows it receives from the stream, so the SQL dwh_adhoc_useful_life step is going to be initialized at the beginning, even if it doesn't receives rows.

Usually that's not a problem because it usually expects something from the stream of rows it receives, but in your case it really doesn't need anything from the rows it receives as input, so it generates its own stream of rows and follows up on it.

One way to fix it would be to get the client_ssr_config column to work as an argument to your SQL script, so it only produces results if the correct value is passed (something in the lines of adding an AND 1=client_ssr_config to your filters in the SQL clause)

Upvotes: 1

Related Questions