I'm working with Apache NiFi to pull data from a database table and use the ConvertRecord to change the fetched records from avro to CSV file using AvroReader and CSVRecordSetWriter.
My process works fine when at least one row comes back from the database.
However, when the ExecuteSQL processor outputs a FlowFile containing 0 records (the FlowFile still contains the metadata/avro schema) - ConvertRecord gives me a 0-byte FlowFile output. My settings in the CSVRecordSetWriter service are set to output the header.
Is there a way to have ConvertRecord output a FlowFile that contains just the the header line in this circumstance?
QueryDatabaseRecordinstead since that combines both of them together?