[ 
https://issues.apache.org/jira/browse/NIFI-5828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16689837#comment-16689837
 ] 

Colin Dean commented on NIFI-5828:
----------------------------------

I think more of the {{executesql.*}} attributes 
[set|https://github.com/apache/nifi/blob/102a5288efb2a22cd54815dd7331dfc5826aee91/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/AbstractExecuteSQL.java#L280-L284]
 are similarly affected:

{code:java}
attributesToAdd.put(RESULT_ROW_COUNT, String.valueOf(nrOfRows.get()));
attributesToAdd.put(RESULT_QUERY_DURATION, String.valueOf(executionTimeElapsed 
+ fetchTimeElapsed));
attributesToAdd.put(RESULT_QUERY_EXECUTION_TIME, 
String.valueOf(executionTimeElapsed));
attributesToAdd.put(RESULT_QUERY_FETCH_TIME, String.valueOf(fetchTimeElapsed));
attributesToAdd.put(RESULTSET_INDEX, String.valueOf(resultCount));
{code}

The row count, query duration, fetch time, and index will be what they are as 
of that flowfile, not for the full result set. Execution time will be for the 
full set.

> ExecuteSQL executesql.row.count meaning changes when Max Rows Per Flow File > > 0
> -------------------------------------------------------------------------------
>
>                 Key: NIFI-5828
>                 URL: https://issues.apache.org/jira/browse/NIFI-5828
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 1.8.0
>         Environment: Linux, MSSQL 2016
>            Reporter: Colin Dean
>            Priority: Major
>              Labels: regression
>
> When *Max Rows Per Flow File* ({{esql-max-rows}}) is set greater than 0 to 
> enable it, the {{executesql.row.count}} attribute on the resulting FlowFiles 
> is not the number of rows in the result set but rather the number of rows in 
> the FlowFile.
> This is a deviation from documented behavior, which is "Contains the number 
> of rows returned in the select query".



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to