[
https://issues.apache.org/jira/browse/NIFI-13335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888288#comment-17888288
]
ASF subversion and git services commented on NIFI-13335:
--------------------------------------------------------
Commit 88c026d73143376b6e044ba7f926f09f3a08e131 in nifi's branch
refs/heads/support/nifi-1.x from dan-s1
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=88c026d731 ]
NIFI-13335 Added ability for the XMLRecordReader to handle where an array of
data has different types. (#9358)
Signed-off-by: David Handermann <[email protected]>
> XMLReader drops values from name-value content if values are mixture of
> strings and numbers
> -------------------------------------------------------------------------------------------
>
> Key: NIFI-13335
> URL: https://issues.apache.org/jira/browse/NIFI-13335
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.24.0, 1.27.0, 2.0.0-M4
> Environment: Docker
> Reporter: Stephen Jeffrey Hindmarch
> Assignee: Daniel Stieglitz
> Priority: Major
> Fix For: 2.0.0-M5
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> This is similar to NIFI-13334, but does not require an array of records to
> demonstrate.
> If you create an XMLReader service and set the following:
> * Parse XML Attributes = true
> * Expect Records as Arrays = false
> * Field Name for Content = Value
> Then use the reader in a ConvertRecord processor with a JSONRecordSetWriter
> When parsing a flow file such as
> {noformat}
> <Event Type="foo">
> <System>
> <EventID>0x0001</EventID>
> </System>
> <UserData>
> <Data Name="Param1">String1</Data>
> <Data Name="Param2">String2</Data>
> <Data Name="Param3">String3</Data>
> </UserData>
> </Event>{noformat}
> then the data tags all get parsed with the correct values.
> {noformat}
> [ {
> "Type" : "foo",
> "System" : {
> "EventID" : "0x0001"
> },
> "UserData" : {
> "Data" : [ {
> "Name" : "Param1",
> "Value" : "String1"
> }, {
> "Name" : "Param2",
> "Value" : "String2"
> }, {
> "Name" : "Param3",
> "Value" : "String3"
> } ]
> }
> } ]{noformat}
> But if one of those data tags has a numeric value then all of the values are
> dropped and are replaced with null. For example
> {noformat}
> <Event Type="foo">
> <System>
> <EventID>0x0001</EventID>
> </System>
> <UserData>
> <Data Name="Param1">String1</Data>
> <Data Name="Param2">2</Data>
> <Data Name="Param3">String3</Data>
> </UserData>
> </Event>
> {noformat}
> parses to
> {noformat}
> [ {
> "Type" : "foo",
> "System" : {
> "EventID" : "0x0001"
> },
> "UserData" : {
> "Data" : [ {
> "Name" : "Param1",
> "Value" : null
> }, {
> "Name" : "Param2",
> "Value" : null
> }, {
> "Name" : "Param3",
> "Value" : null
> } ]
> }
> } ]{noformat}
> and all of the tag data is lost.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)