Search code examples
talend

tHiveInput in a loop/iterate?


I currently have a file with a sql query on each row. I'd like to read each row of this file with a tHDFSInput, and execute the query with a tHiveInput. How can I do that ? I have something like this : enter image description here But it just goes in the thiveinput only once.


Solution

  • You should consider using the component tFlowToIterate between the tHDFSInput and the subjob with your tHiveInput.

    In the below example, I generate a flow which contains a sequence of number then for each number, I do a request on my database(I confess it is not a tHiveInput but I guess it is the same logic). enter image description here

    Here is the configuration of the request I use in my tDBRow_1:

    enter image description here

    Hope it will help you.