You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Gideon Korir (JIRA)" <ji...@apache.org> on 2018/12/11 16:57:00 UTC

[jira] [Created] (NIFI-5891) NiFi record serde throws NPE when decimal field has null value

Gideon Korir created NIFI-5891:
----------------------------------

             Summary: NiFi record serde throws NPE when decimal field has null value
                 Key: NIFI-5891
                 URL: https://issues.apache.org/jira/browse/NIFI-5891
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Core Framework
    Affects Versions: 1.8.0
         Environment: RHEL 7.5
Open JDK 1.8

            Reporter: Gideon Korir


When an incoming record has a null decimal field, NiFiRecordSerDe (
org.apache.hive.streaming) throws an NPE when trying to create a HiveDecimal. This causes the PutHive3Streaming processor to skip the record and log a warning.
 
The lines:
{code:java}
val = HiveDecimal.create(record.getAsDouble(fieldName));
{code}
should be changed to something along the lines of:
{code:java}
Double d = record.getAsDouble(fieldName);
val = d == null ? null : HiveRecord.create(d);{code}
The bug is insidious and occurs during Auto-unboxing.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)