Github user JPercivall commented on a diff in the pull request: https://github.com/apache/nifi/pull/178#discussion_r50158533 --- Diff: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java --- @@ -164,17 +166,19 @@ public void process(final OutputStream out) throws IOException { }); // set attribute how many rows were selected - outgoing = session.putAttribute(outgoing, RESULT_ROW_COUNT, nrOfRows.get().toString()); + fileToProcess = session.putAttribute(fileToProcess, RESULT_ROW_COUNT, nrOfRows.get().toString()); - logger.info("{} contains {} Avro records; transferring to 'success'", new Object[] {outgoing, nrOfRows.get()}); - session.getProvenanceReporter().modifyContent(outgoing, "Retrieved " + nrOfRows.get() + " rows", stopWatch.getElapsed(TimeUnit.MILLISECONDS)); - session.transfer(outgoing, REL_SUCCESS); + logger.info("{} contains {} Avro records; transferring to 'success'", + new Object[] {fileToProcess, nrOfRows.get()}); + session.getProvenanceReporter().modifyContent(fileToProcess, "Retrieved " + nrOfRows.get() + " rows", + stopWatch.getElapsed(TimeUnit.MILLISECONDS)); + session.transfer(fileToProcess, REL_SUCCESS); } catch (final ProcessException | SQLException e) { --- End diff -- This error handling should be expanded a bit more. In the event there is no incoming flowfile then the processor should yield when an error is occurred. Also the log statements should be changed a bit to better reflect the state the processor is in. For example the else statement says that the error is caused by the flowfile but that isn't true when it's a source processor (the flowfile is created to hold the content, doesn't influence the query).
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---