Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I am trying to load database parameter values from an external file to tcontextload and then used a tBufferOutput in the child job to push the informations Iwant to return to the parent job.
The schema of the tBufferOutput is be the same as the one which is declared for the tRunJob.
In the parent job i have redshift and aws components that i have to connect to.Can someone tell me how to set context variables in code (in tJava) components?
If someone can send me the job flow or how it should look like, it would be great.
Thanks.
I am not sure what is your use case but if you want to transfer context from child to Parent , you can simply follow the screen shot which I gave above.
in Child
tContextDump -- tBufferOutput
in Parent -
tRunjob ( same schema as tContextDump ) -- tContextLoad
In tjava
context.variablename = newvalue
Hi akumar,
Can you please elaborate? In the trunjob, i checked the option "Transmit whole context" and "Die on child error" and i am not passing any context parameters. Next, in the tjava component you said i should have context.variablename = newvalue. what do you mean by new value? I didn't get you. When i use the code context.AWS_accountid = row3.AWS_accountid in tjava, it says aws_accountid variable cannot be resolved or is not a field
Hi @desanip
While assigning the value context.AWS_accountid = row3.AWS_accountid could you please try using tjavarow instead of tjava and see if it works.
Regards,
Pratheek Manjunath
in ParentJob
Thanks for the replies everyone.
I am afraid i still dont get it. All i am trying to do is to return the values of the child job to parent job. In job4 i am bringing the database conenction parameters as a key/value pair and passign to tbuuferout. in job3 I am using trunjob to call the child job and then use a tjavarow to set the context so that i can use them in s3 and redshift components. In the trunjob, do i just check "Transmit whole context" and it should take care of everything?
In the tjavarow, i am setting contexts like this "context.AWS_accountid = input_row.AWS_accountid". Is this correct?
Job3 screenshot has the parent job.
Job4 is the child job.
"Transmit whole context" is to transfer context from Parent to child not otherway around.
http://garpitmzn.blogspot.com/2012/11/transmit-whole-context-from-parent-to.html
Ok abhishek. In that case what should i be passing the context param section of trunjob? Should i assign context variables in tjavarow? If so, can you please show me how?
Thanks for your patience and prompt replies
I am not sure what is your use case but if you want to transfer context from child to Parent , you can simply follow the screen shot which I gave above.
in Child
tContextDump -- tBufferOutput
in Parent -
tRunjob ( same schema as tContextDump ) -- tContextLoad