Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am having difficulty understanding how Talend runs the components of a job.
In the screen-shot below, I read a varchar from a Microsoft SQL Server table (table has only one row and one column, with a varchar (10) containing ‘190’).
I then want to store this string in a Variable for later use.
The components seem to execute in parallel, instead of one after another. I see from the forum that this is a common problem, but I don’t understand it.
tJava_1 contains the simple code shown below, but it always displays Null instead of the expected string ‘190’.
tJava_1 contains this simple code –
System.out.println("tJava_1 " + (String)row2.Num_Days);
globalMap.put("myKey", (String)row2.Num_Days);
System.out.println("myKey is " + globalMap.get("myKey"));
Here is what I get –
Starting job Medora_test_Copy_2_Copy at 10:40 01/09/2017.
[statistics] connecting to socket on port 3734
[statistics] connected
tJava_1 null
myKey is null
Num_Days: 190
[statistics] disconnected
Job Medora_test_Copy_2_Copy ended at 10:40 01/09/2017. [exit code=0]
It looks like the code in tJava_1 executes before tMSSQLInput_1 has even started reading from SQL Server.
How can I stop the tJava_1 component from executing until the tMSSqlInput_1 component has finished please?
Is there an explanation on the web of how Talend controls order-of-execution of the components please?
I think I understand why I am confused, but not how to escape from the confusion
Regards
Jon
R.J Lester
Data Warehouse Developer
Customer Support and Innovation Centre
Maidstone & Tunbridge Wells Trust Phone: 01622 225616
Email: jon.lester@nhs.net
The order is what you expect but the result on the console (from tLogRow) comes when the job is finished.
Change the tJava by a tJavaRow component to access the tMSSQLInput_1 result (get the fileds value using input_row.Num_Days instead of row2.Num_Days).
The order is what you expect but the result on the console (from tLogRow) comes when the job is finished.
Change the tJava by a tJavaRow component to access the tMSSQLInput_1 result (get the fileds value using input_row.Num_Days instead of row2.Num_Days).
Thanks very much TRF,
My small job works fine now!
I didn't understand the tJavaRow_1 component, so I had not tried it until I saw your answer.
This Talend Open Studio is very useful and I think it should be used more in the NHS (National Health Service, ie healthcare in the UK)
Regards
Jon
Great! Thank's for the Kudo.
I'm not from Talend, but Talend people will be happy of your comment.
You're welcome if you need more help.