Load value dynamically to tSampleRow

Five Stars

Load value dynamically to tSampleRow

I have a input file with 10 columns and a simple tmap which process the 10 columns and send it to tSampleRow where i hardcoded and to output file. It works fine. 

Now i need to change the value of tSampleRow dynamically ( fetch value from database and set in context variable) and use the context variable in tSampleRow.

1. Job

2. ChildJob ( for loading context variable ) which works fine

3. tRunJob

4. tSampleRow

 

Can you help me how to give the value in tSampleRow and What should i assign in tRunJob Context column.

 

Child Job works fine :

System.out.println("hi");

System.out.println(context.rows);

globalMap.put("output",context.rows);

System.out.println((String)globalMap.get("output"));

 

Starting job DatabaseJob at 15:32 03/04/2018.

[statistics] connecting to socket on port 3705
[statistics] connected
tContextLoad_4 set key "days" with value "monday"
tContextLoad_4 set key "rows" with value "5"
hi
5
5
[statistics] disconnected
Job DatabaseJob ended at 15:32 03/04/2018. [exit code=0]

 

Accepted Solutions
Nine Stars

Re: Load value dynamically to tSampleRow

Hi Dinesh,

 

Are you looking for this ?

You need to define context value in DB. like key=rows and value=1..5

assign this using context load in job and use context.rows in tSampleRow.

 

ContextSampleRow1.pngContextSampleRow2.png

Regards,

 

Veeru Boppudi

All Replies
Nine Stars

Re: Load value dynamically to tSampleRow

Hi Dinesh,

 

Are you looking for this ?

You need to define context value in DB. like key=rows and value=1..5

assign this using context load in job and use context.rows in tSampleRow.

 

ContextSampleRow1.pngContextSampleRow2.png

Regards,

 

Veeru Boppudi

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now

How to Modernize Your Cloud Platform for Big Data Analytics With Talend and Micr...

Learn how<SPAN>to modernize your Cloud Platform for Big Data Analytics with Talend and Microsoft Azure</SPAN>

Read