[
https://issues.apache.org/jira/browse/NIFI-8135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Matt Burgess updated NIFI-8135:
-------------------------------
Fix Version/s: 2.0.0
1.24.0
(was: 1.latest)
(was: 2.latest)
Resolution: Fixed
Status: Resolved (was: Patch Available)
> 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: 2.0.0, 1.24.0
>
> Time Spent: 1h 10m
> 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)