Github user mattyb149 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/178#discussion_r50170753
  
    --- 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 --
    
    I think the if(fileToProcess == null) block can now be removed, it was left 
over from when there were (up to) two references to the flowfile. At this point 
fileToProcess can't be null unless session.create() throws an exception, which 
would be bad.
    
    Point taken for the log statements and the penalize, will update to reflect 
your comments, thanks!


---
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.
---

Reply via email to