Github user patricker commented on a diff in the pull request: https://github.com/apache/nifi/pull/2243#discussion_r166179486 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java --- @@ -268,8 +278,23 @@ public void process(OutputStream out) throws IOException { } }); + fileToProcess = session.putAttribute(fileToProcess, CoreAttributes.MIME_TYPE.key(), JdbcCommon.MIME_TYPE_AVRO_BINARY); session.transfer(fileToProcess, REL_SUCCESS); } + } else if(resultCount == 0){ + //If we had no inbound FlowFile, no exceptions, and the SQL generated no result sets (Insert/Update/Delete statements only) --- End diff -- Prior to my previous change (https://github.com/apache/nifi/pull/1471) only a single flowfile could be returned. The way the code was written, if no incoming flowfile existed then `session.create()` was called. The result, whether it be a large resultset or no result at all, was written using a `session.write` call. Thus a flowfile would always be returned.
---