使用Nifi 1.8.0将XML转换为CSV并使用ValidateRecord 仅隔离“不良”记录。
在ValidateRecord之后,将修改XML记录内的字段顺序。
这是一个错误还是我错过了一些配置?
你好
我有以下工作: FetchFile-> SplitXml-> ValidateRecord-> ConvertRecords ...
我的Avro架构如下:
{
"type": "record",
"name": "record_tag",
"fields" : [
{"name": "id", "type": ["null","string"]},
{"name": "firstname", "type": ["null","string"]},
{"name": "lastname", "type": ["null","string"]},
{"name": "birthdate", "type": ["null","string"]},
{"name": "birthcity", "type": ["null","string"]},
{"name": "birthstate", "type": ["null","string"]},
{"name": "street_number", "type": ["null","string"]},
{"name": "street", "type": ["null","string"]},
{"name": "city", "type": ["null","string"]},
{"name": "acronym", "type": ["null","string"]},
{"name": "state", "type": ["null","string"]},
{"name": "email", "type": ["null","string"]},
{"name": "data1", "type": ["null","string"]},
{"name": "data2", "type": ["null","string"]},
{"name": "data3", "type": ["null","string"]},
{"name": "data4", "type": ["null","string"]},
{"name": "data5", "type": ["null","string"]},
{"name": "data6", "type": ["null","string"]},
{"name": "date", "type": ["null","string"]},
{"name": "number", "type": ["null","string"]}
]
}
在ValidateRecord之前,XML字段的顺序与架构兼容 在ValidateRecord之后,XML的顺序保持一致
date
firstname
birthdate
data6
birthcity
data5
city
acronym
data4
data3
data2
data1
lastname
number
street
birthstate
street_number
id
state
email
我尝试了不同的方法:使用schema_text / schema注册表,问题仍然存在。
致谢