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