[
https://issues.apache.org/jira/browse/NIFI-10508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606004#comment-17606004
]
ASF subversion and git services commented on NIFI-10508:
--------------------------------------------------------
Commit ec09c56e933c8418c97f89bfbcf898c8338b5d06 in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=ec09c56e93 ]
NIFI-10508: When inferring data types for values, allow float and double to
encapsulate byte/short/int/long values
Signed-off-by: Matthew Burgess <[email protected]>
This closes #6421
> Improve Record type inference between integer and floating-point fields
> -----------------------------------------------------------------------
>
> Key: NIFI-10508
> URL: https://issues.apache.org/jira/browse/NIFI-10508
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> When we configure a Record Reader to infer the type of an object, and it
> finds two values, one of which is an integer (or short, long, etc.) and the
> other is a floating point number (float, double, etc) the inferred type
> becomes a CHOICE between an int and a double, for example.
> But this is really not a great inference. It is common to see JSON or CSV
> data, for example, where numbers are truncated if they have no decimals
> (i.e., 5.0 becomes 5). It doesn't really make sense to then write this as a
> union between an int and a double, as the real type of the field is a double.
> We should improve the inference logic to allow float and doubles to
> encapsulate byte/short/int/long values.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)