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

ASF subversion and git services commented on NIFI-5891:
-------------------------------------------------------

Commit c51512f5e33cbd413b1fda8700408aa95614680e in nifi's branch 
refs/heads/master from gkkorir
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=c51512f ]

NIFI-5891 fix handling of null logical types in Hive3Streaming processor

NIFI-5891: Fixed Checkstyle issues
Signed-off-by: Matthew Burgess <[email protected]>

This closes #3216


> 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
>         Environment: RHEL 7.5
> Open JDK 1.8
>            Reporter: Gideon Korir
>            Priority: Major
>
> 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)

Reply via email to