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!
Learn how to make your data more available, reduce costs and cut your build time
Read about OTTO's experiences with Big Data and Personalized Experiences
Take a look at this video about Talend Integration with Databricks