title: Can Pig be used to LOAD from Parquet table in HDFS with partition, and add partitions as columns?
body: <p>I have an Impala partitioned table, store as Parquet. Can I use Pig to load data from this table, and add partitions as columns?</p>
  
  <p>The Parquet table is defined as:</p>
  
  <pre><code>create table test.test_pig (
      name: chararray,
      id bigint
  )
  partitioned by (gender chararray, age int)
  stored as parquet;
  </code></pre>
  
  <p>And the Pig script is like:</p>
  
  <pre><code>A = LOAD '/test/test_pig' USING parquet.pig.ParquetLoader AS (name: bytearray, id: long);
  </code></pre>
  
  <p>However, <code>gender</code> and <code>age</code> are missing when <code>DUMP A</code>. Only <code>name</code> and <code>id</code> are displayed.</p>
  
  <p>I have tried with:</p>
  
  <pre><code>A = LOAD '/test/test_pig' USING parquet.pig.ParquetLoader AS (name: bytearray, id: long, gender: chararray, age: int);
  </code></pre>
  
  <p>But I would receive error like:</p>
  
  <blockquote>
    <p>ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1031: Incompatable
    schema: left is "name:bytearray,id:long,gender:bytearray,age:int",
    right is "name:bytearray,id:long"</p>
  </blockquote>
  
  <p>Hope to get some advice here. Thank you!</p>