ASF GitHub Bot commented on NIFI-4862:

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

    --- Diff: 
    @@ -437,6 +451,16 @@ private void onTrigger(final ProcessContext context, 
final ProcessSession sessio
session.putAttribute(resultSetFlowFiles.get(i), "fragment.count", 
    +                    if(copyAttributtes)
    +                    {
    +                        for(Map.Entry<String, String> entry : 
fileToProcess.getAttributes().entrySet()) {
    --- End diff --
    The attributes on the original flowfile are static, but this logic is 
placed inside a loop which iterates over every resulting flowfile (there may be 
many) and performs the same extraction multiple times. Please move the 
retrieval of the original attributes outside of the loop and store them in a 
local variable, then use `session.putAllAttributes(resultSetFlowFiles.get(i), 
map);` inside the loop to copy all the original attributes into the new 

> Add Copy original attributtes to SelectHiveQL processer
> -------------------------------------------------------
>                 Key: NIFI-4862
>                 URL: https://issues.apache.org/jira/browse/NIFI-4862
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 1.5.0
>            Reporter: Jakub Leś
>            Priority: Minor
>         Attachments: 
> 0001-NIFI-4862-Add-Copy-original-attributtes-to-SelectHiv.patch
> Hi, 
> Please add "Copy original attributes" to processor SelectHiveQL. Thanks to 
> that we can use HttpRequest and HttpResponse to synchronize fetching query 
> result in webservice.

This message was sent by Atlassian JIRA

Reply via email to