You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/10/19 17:14:00 UTC
[jira] [Commented] (NIFI-8135) DataTypeUtils conversion methods for Records to java Maps should respect Choice types
[ https://issues.apache.org/jira/browse/NIFI-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17777385#comment-17777385 ]
ASF subversion and git services commented on NIFI-8135:
-------------------------------------------------------
Commit fd6e0230392704ee81e95b2ff2b19f4fd3dbd774 in nifi's branch refs/heads/support/nifi-1.x from Chris Sampson
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=fd6e023039 ]
NIFI-8135 allow CHOICE data types in conversion of Records to Java Maps
Signed-off-by: Matt Burgess <ma...@apache.org>
> DataTypeUtils conversion methods for Records to java Maps should respect Choice types
> -------------------------------------------------------------------------------------
>
> Key: NIFI-8135
> URL: https://issues.apache.org/jira/browse/NIFI-8135
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.11.4
> Reporter: Chris Sampson
> Assignee: Chris Sampson
> Priority: Major
> Fix For: 1.latest, 2.latest
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Where a schema field is a Map of Choice, with options of Array (of Strings), Map (of Strings) or String, Record Readers incorrectly deserialise the data of the nested Map/Array as Records containing no schema. When converting the overall Record into a java Map using DataTypeUtils, the nested MapRecord is not converted into a Map.
> This can lead to data loss between readers & writers.
> This appears to be related to one/more of:
> * missing schema in the nested MapRecord object (even if it's presented with the data to the Record Reader) - the conversion methods could infer a schema for such MapRecords rather than effectively skipping them
> * Choice types don't appear to be respected for nested fields (e.g. checking whether the options within a Choice are for Map or Array, not just whether the field dataType passed to the conversion method is for Map or Array, etc. ... it's a Choice that should allow for these)
> * Array/ Map conversion should not assume all elements within the collection are of the same type, especially if the field's type is Choice
--
This message was sent by Atlassian Jira
(v8.20.10#820010)