5
votes

I am working on converting huge xml files to avro format, and as a part of this I will have to use the XSD schema to generate Avro file schema - using Python (preferably). I cannot find any valid resources for this conversion. Can the community please help me with this ?

Following is the sample format of XSD file:

<xsd:complexType name="tablename">
- <xsd:sequence>
  <xsd:element name="column1" type="String38" /> 
  <xsd:element name="column2" type="String255" /> 
  <xsd:element name="column3" type="String255" minOccurs="0" /> 
  <xsd:element name="column4" type="ValidDate" minOccurs="0" /> 
</xsd:sequence>
<xsd:attribute name="schemaVersion" type="xsd:string" use="required" /> 
</xsd:complexType>
1

1 Answers

0
votes

I guess, your best bet would be filling in the config file appropriately and calling this tool: https://github.com/GeethanadhP/xml-avro with needed arguments.