Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a table in redshift with a few columns. The data in column A defines the execution order.
If A = Red then I need to write the output to a file. If A = Yellow then I need to load the data into another table.
How do I implement this requirement ?
Which component can I use which sends the action to the required path according to the data in the table?
OK. Then all you need to do is connect your database component (or whatever brings your data in) to a tFlowToIterate component. This will, for every row, create globalMap variables for every column. So if you have a row with columns called "col1", "col2" and "col3" and your row feeding the tFlowToIterate is called "row1", your globalMap variables will be available using the following code.....
Assuming "col1" is a String
((String)globalMap.get("row1.col1"))
Assuming "col2" is an Integer
((Integer)globalMap.get("row1.col2"))
Assuming "col3" is a Long
((Long)globalMap.get("row1.col1"))
Now, connect your tFlowToIterate to a tJava using an iterate link. Then from the tJava use RunIf links and use the globalMap variables as the values for the IF condition logic. The RunIfs will be used to point to the components that you want run conditionally.
You can use a tMap for this. You can have an output for each scenario and use the filtering functionality of the tMap. This page here might help.....
https://help.talend.com/reader/QgrwjIQJDI2TJ1pa2caRQA/rvIDyyz_tAaUI42YybAZ6w
OK. Then all you need to do is connect your database component (or whatever brings your data in) to a tFlowToIterate component. This will, for every row, create globalMap variables for every column. So if you have a row with columns called "col1", "col2" and "col3" and your row feeding the tFlowToIterate is called "row1", your globalMap variables will be available using the following code.....
Assuming "col1" is a String
((String)globalMap.get("row1.col1"))
Assuming "col2" is an Integer
((Integer)globalMap.get("row1.col2"))
Assuming "col3" is a Long
((Long)globalMap.get("row1.col1"))
Now, connect your tFlowToIterate to a tJava using an iterate link. Then from the tJava use RunIf links and use the globalMap variables as the values for the IF condition logic. The RunIfs will be used to point to the components that you want run conditionally.