Aldrin,

A heads up here just make sure you are aware: you cannot add an attribute with 
a null value. 

Sent from my iPhone

> On Apr 17, 2015, at 11:35 PM, Aldrin Piri (JIRA) <[email protected]> wrote:
> 
> 
>    [ 
> https://issues.apache.org/jira/browse/NIFI-476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14501069#comment-14501069
>  ] 
> 
> Aldrin Piri commented on NIFI-476:
> ----------------------------------
> 
> Thanks for the test case.  
> 
> Providing code to solve the inappropriate treatment of null values.  
> Additionally provided a user configurable option to specify if null values 
> should be treated as an empty string or as the literal string "null".
> 
>> EvaluateJsonPath fails with NullPointerException on null values
>> ---------------------------------------------------------------
>> 
>>                Key: NIFI-476
>>                URL: https://issues.apache.org/jira/browse/NIFI-476
>>            Project: Apache NiFi
>>         Issue Type: Bug
>>         Components: Extensions
>>   Affects Versions: 0.0.2, 0.1.0
>>           Reporter: Brian Ghigiarelli
>>           Assignee: Aldrin Piri
>>            Fix For: 0.1.0
>> 
>>        Attachments: NIFI-476-EvaluateJsonPath-Null-Value-Test.patch
>> 
>> 
>> The EvaluateJsonPath processor fails with a NullPointerException when the 
>> input JSON has a null value in the contents of a field it is evaluating.
>> {code:none}
>> Caused by: java.lang.NullPointerException
>>    at 
>> org.apache.nifi.processors.standard.AbstractJsonPathProcessor.getResultRepresentation(AbstractJsonPathProcessor.java:84)
>>    at 
>> org.apache.nifi.processors.standard.EvaluateJsonPath.onTrigger(EvaluateJsonPath.java:268)
>>    at 
>> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
>> {code}
>> null is a valid value in the [JSON spec|http://www.json.org/]
>> The current spec of EvaluateJsonPath from NIFI-360 indicated that any 
>> missing fields should be given an empty string attribute value in the output 
>> flow file sent to "match".
>> null values should either follow this same pattern, or perhaps allow for 
>> null values in the output FlowFile attributes to properly indicate the 
>> difference between null and an empty String.  Either way, EvaluateJsonPath 
>> should handle null input values instead of throwing exceptions.
> 
> 
> 
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)

Reply via email to