[resolved] Add rows to an existing data flow, up to a fixed number

[resolved] Add rows to an existing data flow, up to a fixed number

I have a job where the requirement is to create the same number of files each run, adding dummy files if there are fewer than the maximum number of rows.
My schema is very simple - one String column, which can be set to empty string for the dummy rows.
I see tRowGenerator, but I don't see how to use it add to an existing flow.
So right now I have
tPostgresInput -> tIterate ->
I want to add something after tPostgresInput that will cause tIterate to always happen 6 times (the query will always generate 6 or fewer rowss). (I can know I can change the SQL in postgress to do this but I'm hoping to find something that keeps the logic more in talendComponents).

Accepted Solutions

Re: [resolved] Add rows to an existing data flow, up to a fixed number

Start with a tFixedFlowInput that has a list of ALL files, with this as the main flow connect to a tMap with your current file names as a lookup (make sure the join is not configured as an inner join). This should give you a flow that will contain a row for every file defined in the tFixedFlowInput-- which you can then use to iterate over to create your files.
edit:
for a more maintainable solution you can do the same with a DB table or delimited file that defines all expected files rather than a fixedFlow. This is more maintainable because you would need to edit the job to adjust your file list if you use a fixedFlow.

All Replies

Re: [resolved] Add rows to an existing data flow, up to a fixed number

Start with a tFixedFlowInput that has a list of ALL files, with this as the main flow connect to a tMap with your current file names as a lookup (make sure the join is not configured as an inner join). This should give you a flow that will contain a row for every file defined in the tFixedFlowInput-- which you can then use to iterate over to create your files.
edit:
for a more maintainable solution you can do the same with a DB table or delimited file that defines all expected files rather than a fixedFlow. This is more maintainable because you would need to edit the job to adjust your file list if you use a fixedFlow.

Re: [resolved] Add rows to an existing data flow, up to a fixed number

Thank you. That's exactly what I was looking for, I've updated my job using your suggestion and it works.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now