[ 
https://issues.apache.org/jira/browse/NIFI-6090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16792059#comment-16792059
 ] 

Matt Burgess commented on NIFI-6090:
------------------------------------

This is a limitation of Avro schemas (see 
[here|http://apache-avro.679487.n3.nabble.com/Duplicate-field-names-inside-nested-records-td4025085.html]
 for more details) where you can't reuse the name in the schema. The NiFi 
Record code seems to correctly generate a union of different record types that 
"segments" could be, but when the Avro schema is created (for the 
AvroRecordSetWriter), Avro complains. I believe you'd have to use a different 
output format besides Avro (and don't write the schema to an attribute).

> Issure infering schema with ConvertRecord
> -----------------------------------------
>
>                 Key: NIFI-6090
>                 URL: https://issues.apache.org/jira/browse/NIFI-6090
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 1.9.0
>         Environment: DEV
>            Reporter: Richard Walden
>            Priority: Major
>         Attachments: SampleJSON.json
>
>
> I am trying to convert a JSON file to AVRO using ConvertRecord.  I have a 
> JSONTreeReader as the reader and the AvroRecordSetWriter as the writer.  I am 
> infering the schema on the reader.  I'm getting the following error message 
> in ConvertRecord:
> 2019-02-28 12:14:26,654 ERROR [Timer-Driven Process Thread-1] 
> o.a.n.processors.standard.ConvertRecord 
> ConvertRecord[id=34f9e5e2-0169-1000-645c-5230a4e197cc] Failed to process 
> StandardFlowFileRecord[uuid=5d828228-fe1c-4697-b05a-423670a84019,claim=StandardContentClaim
>  [resourceClaim=StandardResourceClaim[id=1551377666344-137, 
> container=default, section=137], offset=269889, 
> length=1826274],offset=0,name=2019-02-20-101503.234_HB-NHHF-ACH-1023092053-20190220-0900108193-88187.46-835-06360062.835,size=1826274];
>  will route to failure: org.apache.avro.SchemaParseException: Can't redefine: 
> org.apache.nifi.segmentsType
>  
> I've attached a sample of the JSON file, with information redacted, for 
> review.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to