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

ASF GitHub Bot commented on NIFI-4862:
--------------------------------------

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

    https://github.com/apache/nifi/pull/2467#discussion_r167957594
  
    --- Diff: 
nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/SelectHiveQL.java
 ---
    @@ -437,6 +451,16 @@ private void onTrigger(final ProcessContext context, 
final ProcessSession sessio
                             resultSetFlowFiles.set(i,
                                     
session.putAttribute(resultSetFlowFiles.get(i), "fragment.count", 
Integer.toString(fragmentIndex)));
                         }
    +
    +                    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 
flowfile. 


> 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
(v7.6.3#76005)

Reply via email to