As shown in attached the job design we have tFilterRow component connected to tJavaRow component. But tFilterRow component is not returning any row because rows are not satisfying the condition mentioned in tFilterRow component . Here is the code snippet I have written in tJavaRow component.
if(input_row != null && input_row.AccountNumber != null)
context.AccountNumber = input_row.AccountNumber;
System.out.println("New AccountNumber Is " + context.AccountNumber);
System.out.println("No Data Fetched");
But when I ran the job the console didn’t print any thing. Actually I was expecting “No Data Fetched” to be printed as no row is being returned. As per my understanding either input_row is null or input_row.AccountNumber is null.
Both of these two should not be null when row is being returned from tFilterRow component. Here AccountNumber is a field of Accounts table in Sales Force.
Please help me where I am wrong?
The flow is not getting to the tJavaRow. If a row is filtered, the next component will not do anything. There is no row to process. It won't pass a null row. This suggests that you tFilterRow is not allowing anything through. Can you elaborate on the tFilterRow?
Just for your information tFilterRow is working fine as per current scenario it will not return any row. There is no problem with tJavaRow.
Did you mean that as no row is being getting passed to tJavaRow from tFilterRow hence flow is not passed to tJavaRow?
But I have noticed there is "Run IF" component being applied from tJavaRow component which connects to other sub job. And this "Run IF" component is returning true causing the subjob to run.
If I go by your answer then flow is getting passed to tJavaRow component. I am not sure why then "Run IF" component is returning true. Flow should not get passed to "Run IF" component also?
The RunIf does not rely on a row of data. It is a True/False decision trigger. It fires once the component has finished (got to the end of the flow). Since the tJavaRow was triggered but did not receive any rows, it completed immediately.
Unless the job fails, all components start and end. But they may not receive rows. This is an important concept to grasp. You will notice perceived weirdness like this and will have to build around it. Knowing about it and considering it helps a lot :-)
Here is my understanding :-
a. Unless Job fails all components will start and end.
b. In case component which rely on a row of data doesn't receive any row then that component will end immediately without executing any logic associated with it.
Please tell me if my understanding is correct.
Yes, that pretty much sums it up. There are other rules involving tPostJob components and tDies, etc, but you pretty much have the main logic there.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema
Pick up some tips and tricks with Context Variables