Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap and tJoin component wont accept 2nd connection

I have a process where I want to join the upper and lower flows using a tMap but once I connect 1 component's input to the tMap I can't connect the other. If I create a basic job with 2 ExcelFileInputs I can join 1 to a tMap and get the lookup connection for the other.
Any troubleshooting or debugging advice as to why tMap or tJoin won't accept a 2nd connection for this particular job?
0683p000009MDuc.png
Labels (2)
7 Replies
cterenzi
Creator III
Creator III

Talend won't let you create a circular path in a job. Instead of replicating a flow and joining it back, use two input components with the same source.
Anonymous
Not applicable
Author

Hiya, Thanks for helping out. I'm not sure I follow as the 2 input components are using the same file as input I just need to process row 1 differently to extract some extra data and join it with rows 3 onwards (which I validate against a schema beforehand)
If I can't join the flows together whats the best way to store temporary values I extract from the header row so I can include it in tMap
TRF
Creator III
Creator III

Hi,
You cannot separate a flow (using tReplicate or tMap for example) and reunify it (using tUnite or tMap for example) in the same subjob.
Regards,
TRF
Anonymous
Not applicable
Author

So is there a recommended way to process a file which has the structure
Legend  

|1| = row number
Comma used to indicate separate cells in excel

|1|This report was generated at 23:20 September 2014
|2|
|3|Machine,Status,Value
|4|A, Good, 14
|5|A, Bad, 10

and end up with 
|1|Machine,Status,Value,Time,Month,Year
|2|A, Good, 14, 23:20,September,2014
|3|A, Bad, 10,23:20,September,2014
TRF
Creator III
Creator III

1- read 1st line using tFileInputMSDelimited and to retrieve hour and date as 3 separate fields of the same record stored in tHashOutput_1.
2- read file from 4th line to the end and include content of tHashOutput_1 for each record using tMap
                          tHashInput__1
                                     |
tFileInputDelimited  --> tMap --> tFileOutputDelimited
You may prefer to store result of step 1 into 3 global variables (time, month, year) then use them to populate the records in tMap (no need of tHash neither join in tMap). 
In this case, just use a tJavaRow after tFileInputMSDelimited and "globalMap.put" to store values in the variables.
Regards,
TRF
Anonymous
Not applicable
Author

Could I put the File Inputs in serial (not parallel as they are above) and use setGlobalvars / globalMap.put before the 2nd Input?
tFileExcelInput -->ExtractVarsFromRow1 -->SetGlobalVar -->tFileExcelInput(same input settings) -->tMap (with GlobalVars)--->FileOutput                                                                                                                                    
Is there a possibility of File Locks or other issues?
TRF
Creator III
Creator III

You should prefer this design:
tFileExcelInput --> tJava ( SetGlobalVar)
 |
onSubjobOk
 |
tFileExcelInput(same input settings) -->tMap (with GlobalVars)--->FileOutput
No risk of lock and better for lisibility and maintainability.
Regards,
TRF