Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ! Wanted to check if there is any way to create a generic job that does the following -
tRunJob component for Department having Context Params Department as target table and Dept as flow param
Please advise how to approach a scenario like this.
Parent job:
Context Param values that gets passed to child job for Employee:
Child job:
Hi ! Could someone please help? 🙂
Hi
Because the employee and department table have different structure and tXMLMap don't support different output flow based on variable, so you can't create a generic job flow for different target object. As a workaround, create different subjobs, and use runIf connector to trigger the subjob based on the context variable. For example:
tJava--runIf1--tFileInputXML--tXMLMap--tSnowFlakeOutput(for employee)
--runIf2---tFileInputXML--tXMLMap--tSnowFlakeOutput(for department )
on tJava:
if(context.tableName.equals("employee")){
globalMap.put("runEmployeeFlow",true);
}
if(context.tableName.equals("department")){
globalMap.put("runDepartmentFlow",true);
}
Set the condition of runIf1 as:
(Boolean)globalMap.get("runEmployeeFlow")
Set the condition of runIf2 as:
(Boolean)globalMap.get("runDepartmentFlow")
Hope it helps!
Regards
Shong
Hi @Shicong Hong ! I would want to load both Employee and department in a single load. XML file will contain both Employee and Department information. Running subjobs based on context variable would allow only one dataset, either Employee or Department, to be loaded to Snowflake table.
Tried testing with the below design, but the load seem to take 13-15 minutes to complete for a 2MB XML file
How can i design this better?