[
https://issues.apache.org/jira/browse/NIFI-476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Brian Ghigiarelli updated NIFI-476:
-----------------------------------
Description:
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.
was:
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, EvaluateJsonProcessor should
handle null input values instead of throwing exceptions.
> 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
> 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)