Below is my job design,
tFileInputDelimited_1 -> tFlowtoIterate_1 -> tJavaFlex -> tFileInputDelimited_2 -> tJavaRow -> tFlowtoIterate_2 -> tHiveInput -> tFileOutputDelimited_1
I am setting a context variable as below in the tJavaRow.
System.out.println("Value Of Input: "+input_row.table_name); globalMap.put("varTOP", input_row.table_name); System.out.println("Value Of GlobalVar: "+globalMap.get("table_name"));
My problem is,
I need to send the context value of "table_name" dynamically to tFileOutputDelimited_1 and append along with each output record.
eg:-<table_name>-<result_set> ( i am using the delimiter as "-")
Please suggest how to send that contextVariable and append in the tFileOutputDelimited.
Why don't you add a pseudo-column to your query with the tablename?
select 'EMP', code, firstname, lastname from EMP;
just add one more column in tjavarow schema and set its value using globalMap.get("table_name") ,
pass this flow as it is to tFlowToIterate and sync this schema to tHive and tfileoutputDelimited
Watch the recorded webinar!
Create systems and workflow to manage clean data ingestion and data transformation.
Introduction to Talend Open Studio for Data Integration.
Test drive Talend's enterprise products.