title: How to create nested object and array in parquet file?
body: <p>How do I create a parquet file with nested fields? I have the following:</p>
  <pre class="lang-java prettyprint-override"><code>public static void main(String[] args) throws IOException {
  
      int fileNum = 10;   //num of files constructed
      int fileRecordNum = 50; //record num of each file
      int rowKey = 0;
      for (int i = 0; i &lt; fileNum; ++i) {
  
          Map&lt;String, String&gt; metas = new HashMap&lt;&gt;();
          metas.put(HConstants.START_KEY, genRowKey(&quot;%10d&quot;, rowKey + 1));
          metas.put(HConstants.END_KEY, genRowKey(&quot;%10d&quot;, rowKey + fileRecordNum));
  
          ParquetWriter&lt;Group&gt; writer = initWriter(&quot;pfile/scanner_test_file&quot; + i, metas);
  
          for (int j = 0; j &lt; fileRecordNum; ++j) {
              rowKey++;
              Group group = sfg.newGroup().append(&quot;rowkey&quot;, genRowKey(&quot;%10d&quot;, rowKey))
                      .append(&quot;cf:name&quot;, &quot;wangxiaoyi&quot; + rowKey)
                      .append(&quot;cf:age&quot;, String.format(&quot;%10d&quot;, rowKey))
                      .append(&quot;cf:job&quot;, &quot;student&quot;)
                      .append(&quot;timestamp&quot;, System.currentTimeMillis());
              writer.write(group);
          }
  
          writer.close();
      }
  }
  </code></pre>
  <p>I want to create two fields:</p>
  <ol>
  <li>Hobbies which contains a list of hobbies (&quot;Swimming&quot;, &quot;Kickboxing&quot;)</li>
  <li>A teacher object that contains subfields like:
  {
  'teachername': 'Rachel',
  'teacherage':50
  }</li>
  </ol>
  <p>Can someone provide an example how to do this in Java?</p>