Search code examples
talend

How Make Conditional Row Connector in Talend?


I have a Talend job where I have a Postgres input component running a row connector into a tFileOutputDelimited control so I can write the results of the database query to a CSV file with a header line. When there are no rows resulting from the query, it still writes the CSV file with just the header line. I'd prefer it did not write the file at all.

How can I put a condition on the row connector, or refactor this flow, so that it does not run the tFileOutputDelimited component when the Postgres query yields 0 rows?


Solution

  • Check the option "do not generate empty file" on the tFileOutputDelimited' advanced settings. When there are no rows, the file won't be created.