title: Why does my avro schema not work for this dataset?
body: <p>I am using streamsets to get data from an API. The data is in XML format. I need to convert it to parquet in the end but there is a middle stage which requires xml to avro conversion first.</p>
  <p>Below is the data that I get in streamsets -</p>
  <pre><code>XMLData : MAP
     Metadata :  LIST [ 20 ] 
     LevelCounts :  LIST [ 1 ] 
     Record :  LIST [ 46 ] 
     attrcount : STRING
  </code></pre>
  <p>Expanding the metadata would give a list where each element in the list has 4 key value pairs -</p>
  <pre><code>   attr|name : STRING
     attr|guid : STRING
     attr|alias : STRING
     attr|id : STRING
  </code></pre>
  <p>Similary each record in the LevelCounts and Record is made up of a set of key value pairs. Record/Field is similar to the metadata.</p>
  <pre><code>   attr|levelId : STRING
     attr|contentId : STRING
     attr|moduleId : STRING
     attr|parentId : STRING
     attr|levelGuid : STRING
     Field :  LIST [ 20 ] 
  </code></pre>
  <p>I need help understanding why my Avro schema is wrong and what should be the correct one. I get an empty file with the schema in it.</p>
  <p>Below is the avro schema I am using</p>
  <pre><code>{
      &quot;type&quot;: &quot;record&quot;,
      &quot;name&quot;: &quot;XMLData&quot;,
      &quot;fields&quot;: [
  
          {
              &quot;name&quot;: &quot;Metadata&quot;,
              &quot;type&quot;: {
                  &quot;type&quot;: &quot;array&quot;,
                  &quot;items&quot;: {
                      &quot;type&quot;: &quot;map&quot;,
                      &quot;values&quot;: &quot;string&quot;
                  }
              }
          },
  
          {
              &quot;name&quot;: &quot;LevelCounts&quot;,
              &quot;type&quot;: {
                  &quot;type&quot;: &quot;array&quot;,
                  &quot;items&quot;: {
                      &quot;type&quot;: &quot;map&quot;,
                      &quot;values&quot;: &quot;string&quot;
                  }
              }
          },
  
          {
              &quot;name&quot;: &quot;Record&quot;,
              &quot;type&quot;: {
                  &quot;type&quot;: &quot;array&quot;,
                  &quot;items&quot;: [{
                          &quot;type&quot;: &quot;map&quot;,
                          &quot;values&quot;: &quot;string&quot;
                      },
  
                      {
                          &quot;type&quot;: &quot;array&quot;,
                          &quot;items&quot;: {
                              &quot;type&quot;: &quot;map&quot;,
                              &quot;values&quot;: &quot;string&quot;
                          }
                      }
                  ]
              }
          },
  
          {
              &quot;name&quot;: &quot;attrcount&quot;,
              &quot;type&quot;: &quot;string&quot;
          }
      ]
  }
  </code></pre>