Nikeshh Baskaran created AVRO-2809:
--------------------------------------
Summary: SD to Avro Conversion - SchemaParseException: can't
redefine roleNotesGroup
Key: AVRO-2809
URL: https://issues.apache.org/jira/browse/AVRO-2809
Project: Apache Avro
Issue Type: Bug
Components: java
Affects Versions: 1.9.2
Environment: *I am working on converting xsd to avro schema*
*XSD snippet:*
{{<xsd:element
name="*roleNotesGroup*"><xsd:complexType><xsd:sequence><xsd:element
name="*roleNotesSubGroup*" minOccurs="0"
maxOccurs="unbounded"><xsd:complexType><xsd:sequence><xsd:element
name="*roleNotesGroup*" minOccurs="0"
maxOccurs="unbounded"><xsd:complexType><xsd:sequence><xsd:element
name="roleNotes" type="xsd:string"
minOccurs="0"><xsd:annotation><xsd:appinfo><source application="CUSTOMER"
field="REL.CUSTOMER"/><fieldPiiAttribute value="INDIRECT"/><fieldPiiPurpose
value="LEGITIMATE"/><fieldPiiEraseOption
value="NO.ACTION"/><fieldPiiAccessibility value="ACCESS
PORTABLE"/></xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence><xsd:attribute
name="index"
type="xsd:integer"/></xsd:complexType></xsd:element></xsd:sequence><xsd:attribute
name="index"
type="xsd:integer"/></xsd:complexType></xsd:element></xsd:sequence><xsd:attribute
name="index" type="xsd:integer"/></xsd:complexType></xsd:element>}}
{{}}
I am using
*{{Schema schema = Schema.createRecord(name, null, null, false);}}*
to create a avro schema record. In the above xsd roleNotesGroup is a child of
roleNotesSubGroup which is a child of roleNotesGroup. I can recursively obtain
the avro schema till roleNotesSubGroup which is then converted to list.
*{{List<Schema.Field> is obtained recursively.}}*
{{}}
{{}}
Now the problem is when i try to add the Fields formed to the head element
roleNotesGroup using
{{*Schema schema = Schema.createRecord(name, null, null,
false);schema.setFields(schemaFields**);*}}
{{}}
*I get the following error : SchemaParseException: can't redefine
roleNotesGroup*
*Is there any restriction in avro or avro conversion that the same names should
not occur again?*
Reporter: Nikeshh Baskaran
*I am working on converting xsd to avro schema*
*XSD snippet:*
{{<xsd:element
name="*roleNotesGroup*"><xsd:complexType><xsd:sequence><xsd:element
name="*roleNotesSubGroup*" minOccurs="0"
maxOccurs="unbounded"><xsd:complexType><xsd:sequence><xsd:element
name="*roleNotesGroup*" minOccurs="0"
maxOccurs="unbounded"><xsd:complexType><xsd:sequence><xsd:element
name="roleNotes" type="xsd:string"
minOccurs="0"><xsd:annotation><xsd:appinfo><source application="CUSTOMER"
field="REL.CUSTOMER"/><fieldPiiAttribute value="INDIRECT"/><fieldPiiPurpose
value="LEGITIMATE"/><fieldPiiEraseOption
value="NO.ACTION"/><fieldPiiAccessibility value="ACCESS
PORTABLE"/></xsd:appinfo></xsd:annotation></xsd:element></xsd:sequence><xsd:attribute
name="index"
type="xsd:integer"/></xsd:complexType></xsd:element></xsd:sequence><xsd:attribute
name="index"
type="xsd:integer"/></xsd:complexType></xsd:element></xsd:sequence><xsd:attribute
name="index" type="xsd:integer"/></xsd:complexType></xsd:element>}}
{{}}
I am using
*{{Schema schema = Schema.createRecord(name, null, null, false);}}*
to create a avro schema record. In the above xsd roleNotesGroup is a child of
roleNotesSubGroup which is a child of roleNotesGroup. I can recursively obtain
the avro schema till roleNotesSubGroup which is then converted to list.
*{{List<Schema.Field> is obtained recursively.}}*
{{}}
{{}}
Now the problem is when i try to add the Fields formed to the head element
roleNotesGroup using
{{*Schema schema = Schema.createRecord(name, null, null,
false);schema.setFields(schemaFields**);*}}
{{}}
*I get the following error : SchemaParseException: can't redefine
roleNotesGroup*
*Is there any restriction in avro or avro conversion that the same names should
not occur again?*
--
This message was sent by Atlassian Jira
(v8.3.4#803005)