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

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

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

    https://github.com/apache/nifi/pull/1358#discussion_r93988247
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java
 ---
    @@ -288,7 +290,7 @@ public void process(InputStream in) throws IOException {
             int fragmentIndex = 1; // set to 1 to preserve the existing 
behavior *only*. Perhaps should be deprecated to follow the 0,1,2... scheme
             String fragmentId = UUID.randomUUID().toString();
     
    -        if (computedSplitsInfo.size() == 0) {
    +        if ((computedSplitsInfo.size() == 0) && (headerFlowFile != null)) {
    --- End diff --
    
    Thanks @mattyb149 The part of processor description is added since ver 
1.1.0 by NIFI-2851. So I thought @olegz has some reason for that. As I 
mentioned within the previous comment, ver 1.0.0 and earlier don't create that 
header only flow files.
    
    With a situation that you mentioned, I'd like to have no output from 
SplitText to split relationship. If it outputs empty flow files but only with 
header, I'd have to filter out those files in downstream flow.
    
    Maybe this should be discussed separately from this PR. Since this PR fixes 
its target issue, I'll merge this into master.


> NullPointerException in SplitText on empty files
> ------------------------------------------------
>
>                 Key: NIFI-3127
>                 URL: https://issues.apache.org/jira/browse/NIFI-3127
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 1.1.1
>            Reporter: Joseph Gresock
>            Assignee: Joseph Gresock
>             Fix For: 1.2.0
>
>
> This can be reproduced by routing an empty file to SplitText and setting the 
> line split count to 1.
> 2016-11-30 13:00:01,133 ERROR [Timer-Driven Process Thread-62] 
> o.a.nifi.processors.standard.SplitText 
> SplitText[id=7ef1aa84-233c-31d6-b34d-b169660f5284] 
> SplitText[id=7ef1aa84-233c-31d6-b34d-b169660f5284] failed to process due to 
> java.lang.NullPointerException; rolling back session: 
> java.lang.NullPointerException
> 2016-11-30 13:00:01,133 ERROR [Timer-Driven Process Thread-62] 
> o.a.nifi.processors.standard.SplitText
> java.lang.NullPointerException: null
>         at 
> org.apache.nifi.processors.standard.SplitText.generateSplitFlowFiles(SplitText.java:292)
>  ~[nifi-standard-processors-1.1.0.jar:1.1.0]
>         at 
> org.apache.nifi.processors.standard.SplitText.onTrigger(SplitText.java:253) 
> ~[nifi-standard-processors-1.1.0.jar:1.1.0]
>         at 
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
>  ~[nifi-api-1.1.0.jar:1.1.0]
>         at 
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1099)
>  [nifi-framework-core-1.1.0.jar:1.1.0]
>         at 
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
>  [nifi-framework-core-1.1.0.jar:1.1.0]
>         at 
> org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
>  [nifi-framework-core-1.1.0.jar:1.1.0]
>         at 
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
>  [nifi-framework-core-1.1.0.jar:1.1.0]
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> [na:1.8.0_111]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to