@Test
  public void testColumnarStorePushdown() throws Exception {
    String PIGOUTPUT_DIR = TEST_DATA_DIR+ "/colpushdownop";
    String PIG_FILE = "test.pig";
    String expectedCols = "0,1";
    PrintWriter w = new PrintWriter(new FileWriter(PIG_FILE));
    w.println("A = load '" + COMPLEX_TABLE + "' using org.apache.hive.hcatalog.pig.HCatLoader();");
    w.println("B = foreach A generate name,studentid;");
    w.println("C = filter B by name is not null;");
    w.println("store C into '" + PIGOUTPUT_DIR + "' using PigStorage();");
    w.close();

    try {
      String[] args = { "-x", "local", PIG_FILE };
      PigStats stats = PigRunner.run(args, null);
      //Pig script was successful
      assertTrue(stats.isSuccessful());
      //Single MapReduce job is launched
      OutputStats outstats = stats.getOutputStats().get(0);
      assertTrue(outstats!= null);
      assertEquals(expectedCols,outstats.getConf()
        .get(ColumnProjectionUtils.READ_COLUMN_IDS_CONF_STR));
      //delete output file on exit
      FileSystem fs = FileSystem.get(outstats.getConf());
      if (fs.exists(new Path(PIGOUTPUT_DIR))) {
        fs.delete(new Path(PIGOUTPUT_DIR), true);
      }
    }finally {
      new File(PIG_FILE).delete();
    }
  }
Test that value from Hive table are read properly in Pig
hcatalog/hcatalog-pig-adapter/src/test/java/org/apache/hive/hcatalog/pig/AbstractHCatLoaderTest.java